559c1604d7
toRegex now converts string to our regex, and toPattern converts to JVM Pattern.
14 lines
289 B
Kotlin
14 lines
289 B
Kotlin
package test.text
|
|
|
|
import kotlin.*
|
|
import kotlin.test.*
|
|
import org.junit.Test as test
|
|
|
|
class StringUtilTest() {
|
|
test fun toPattern() {
|
|
val re = """foo""".toPattern()
|
|
val list = re.split("hellofoobar").toList()
|
|
assertEquals(listOf("hello", "bar"), list)
|
|
}
|
|
}
|