Temporary workaround due to KT-7502.

Correct usage of joinToString.
Test for passing multiple options.
This commit is contained in:
Ilya Gorbunov
2015-04-18 01:31:26 +03:00
parent 81325208be
commit 260553d516
2 changed files with 11 additions and 3 deletions
+6
View File
@@ -84,6 +84,12 @@ class RegexTest {
assertEquals("bye", m2.groups[2]?.value)
}
test fun matchMultiline() {
val regex = "^[a-z]*$".toRegex(setOf(RegexOption.IGNORE_CASE, RegexOption.MULTILINE))
val matchedValues = regex.matchAll("test\r\nLine").map { it.value }.toList()
assertEquals(listOf("test", "Line"), matchedValues)
}
test fun escapeLiteral() {
val literal = """[-\/\\^$*+?.()|[\]{}]"""
assertTrue(Regex.fromLiteral(literal).matches(literal))