Test backreference to group with index zero

This commit is contained in:
Abduqodiri Qurbonzoda
2022-03-31 01:57:23 +03:00
committed by Space
parent 74121b26c0
commit 187faa121e
6 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -241,6 +241,9 @@ class RegexTest {
testInvalidBackReference(BackReferenceHandling.nonExistentGroup, pattern = "a(a)\\2")
testInvalidBackReference(BackReferenceHandling.enclosingGroup, pattern = "a(a\\1)")
testInvalidBackReference(BackReferenceHandling.notYetDefinedGroup, pattern = "a\\1(a)")
testInvalidBackReference(BackReferenceHandling.groupZero, pattern = "aa\\0")
testInvalidBackReference(BackReferenceHandling.groupZero, pattern = "a\\0a")
}
@Test fun matchCharWithOctalValue() {
@@ -306,7 +309,7 @@ class RegexTest {
// TODO: Test comment mode enabled and group name is separated by space, (before, in the middle, after)
// TODO: Test comment mode enabled and back reference group index is separated by space, (before, in the middle, after)
// TODO: Test back reference with \0
// TODO: IllegalArgumentException to java.util.regex.PatternSyntaxException where possible
@Test fun matchMultiline() {
val regex = "^[a-z]*$".toRegex(setOf(RegexOption.IGNORE_CASE, RegexOption.MULTILINE))