galex
06/25/2019, 5:38 AM1.3.40
to just compile I had to add the following in the root level dependencies block:
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
Running the gradle task build
, which runs the tasks testDebugUnitTest
fails:
> Task :testDebugUnitTest FAILED
com.mu51k.core.util.EmailUtilsTests > emailsAreInvalid FAILED
java.lang.NullPointerException at EmailUtilsTests.kt:20
com.mu51k.core.util.EmailUtilsTests > emailsAreValid FAILED
java.lang.NullPointerException at EmailUtilsTests.kt:12
2 tests completed, 2 failed
The NPE seems weird, as the code looks like that:
assertTrue { "<mailto:glfala@fefr.com|glfala@fefr.com>".emailValid() }
And emailValid()
on Android is the following:
actual fun String.emailValid(): Boolean = Patterns.EMAIL_ADDRESS.matcher(this).matches()
Any idea?gildor
06/25/2019, 5:40 AMgalex
06/25/2019, 5:43 AMgildor
06/25/2019, 5:46 AMnull
in android.jar that used for unit tests (like any other Android Framework method or non-constant field)galex
06/25/2019, 6:04 AM