Hello, does someone have an example of a Multiplatform project that runs common unit tests on its Android library target? Since
1.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?