Files
kotlin-fork/backend.native/tests/external/stdlib/text/RegexTest/matchEntire.kt
T
Ilya Matveev 85827b4880 tests: Copy stdlib tests from Kotlin/JVM
This patch copies Kotlin/JVM stdlib tests (libraries/stdlib/test)
excepting ones with explicit java dependencies. It also transforms
the tests to use them as box-tests.
2017-04-07 17:21:11 +07:00

16 lines
347 B
Kotlin

import kotlin.text.*
import kotlin.test.*
fun box() {
val regex = "(\\d)(\\w)".toRegex()
assertNull(regex.matchEntire("1a 2b"))
assertNotNull(regex.matchEntire("3c")) { m ->
assertEquals("3c", m.value)
assertEquals(3, m.groups.size)
assertEquals(listOf("3c", "3", "c"), m.groups.map { it!!.value })
}
}