Skip to content

Commit 1beb32f

Browse files
natecook1000hamishknight
authored andcommitted
Add test cases for captures in lookaheads
1 parent 3ad9d2c commit 1beb32f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Tests/RegexTests/MatchTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,12 @@ extension RegexTests {
10771077
firstMatchTest(
10781078
#"(?>a++)a"#, input: "aaa", match: nil)
10791079

1080+
firstMatchTest(
1081+
#"(?>(\d+))\w+\1"#, input: "123x12", match: nil)
1082+
firstMatchTest(
1083+
#"(?>(\d+))\w+\1"#, input: "123x23", match: "23x23",
1084+
xfail: true)
1085+
10801086
// TODO: Test example where non-atomic is significant
10811087
firstMatchTest(
10821088
#"\d+(?* dollars)"#,

0 commit comments

Comments
 (0)