Skip to content

Commit 81b84d2

Browse files
authored
Merge pull request #450 from natecook1000/extended_w_quoted_whitespace
Test semantic whitespace in quote in extended region
2 parents 4d04019 + df6e635 commit 81b84d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/RegexTests/MatchTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,14 @@ extension RegexTests {
13051305
firstMatchTest(#"(?xx)[ \t]+"#, input: " \t \t", match: "\t")
13061306

13071307
firstMatchTest("(?xx)[ a && ab ]+", input: " aaba ", match: "aa")
1308+
1309+
// Preserve whitespace in quoted section inside extended syntax region
1310+
firstMatchTest(
1311+
#"(?x) a b \Q c d \E e f"#, input: "ab c d ef", match: "ab c d ef")
1312+
firstMatchTest(
1313+
#"(?x)[a b]+ _ [a\Q b\E]+"#, input: "aba_ a b a", match: "aba_ a b a")
1314+
firstMatchTest(
1315+
#"(?x)[a b]+ _ [a\Q b\E]+"#, input: "aba _ a b a", match: nil)
13081316
}
13091317

13101318
func testASCIIClasses() {

0 commit comments

Comments
 (0)