-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix rules to support blank as they should rely on required to check i…
…f required
- Loading branch information
Showing
5 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
library/src/androidInstrumentedTest/kotlin/com/chrisjenx/yakcov/IOSIgnore.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.chrisjenx.yakcov | ||
|
||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) | ||
actual annotation class IOSIgnore() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
library/src/commonTest/kotlin/com/chrisjenx/yakcov/strings/EmailRuleTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.chrisjenx.yakcov.strings | ||
|
||
import com.chrisjenx.yakcov.IOSIgnore | ||
import com.chrisjenx.yakcov.ValidationResult.Outcome | ||
import com.chrisjenx.yakcov.initPhoneNumberUtil | ||
import kotlin.test.BeforeTest | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class EmailRuleTest { | ||
|
||
@Test | ||
fun email_empty_success() { | ||
assertEquals(Outcome.SUCCESS, Email.validate("").outcome()) | ||
} | ||
|
||
@Test | ||
fun email_invalid_error() { | ||
assertEquals(Outcome.ERROR, Email.validate("43435").outcome()) | ||
} | ||
|
||
@Test | ||
fun email_valid_success() { | ||
assertEquals(Outcome.SUCCESS, Email.validate("[email protected]").outcome()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters