Skip to content

Commit e9f21e6

Browse files
committed
[Test] More word breaking tests
1 parent 4e742b4 commit e9f21e6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Tests/RegexTests/MatchTests.swift

+27
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,33 @@ extension RegexTests {
16831683
firstMatchTest(#"\b÷\b"#, input: "3 ÷ 3 = 1", match: "÷")
16841684
}
16851685

1686+
func testLevel2WordBoundaries_negative() throws {
1687+
// Run some non-match cases, the latter of which used to hang
1688+
1689+
// FIXME: stdlib 5.10 check
1690+
1691+
let re = #"\bA\b"#
1692+
1693+
firstMatchTest(re, input: "⛔️: X ", match: nil)
1694+
firstMatchTest(re, input: "\u{FE0F}: X ", match: nil)
1695+
firstMatchTest(re, input: "👨‍👨‍👧‍👦\u{FE0F}: X ", match: nil)
1696+
1697+
firstMatchTest(re, input: "Z:X ", match: nil)
1698+
1699+
firstMatchTest(re, input: "Z\u{FE0F}:X ", match: nil)
1700+
firstMatchTest(re, input: "è\u{FE0F}:X ", match: nil)
1701+
1702+
firstMatchTest(re, input: "日:X ", match: nil)
1703+
firstMatchTest(re, input: "👨‍👨‍👧‍👦:X ", match: nil)
1704+
1705+
firstMatchTest(re, input: "\u{FE0F}:X ", match: nil)
1706+
firstMatchTest(re, input: "👨‍👨‍👧‍👦\u{FE0F}:X ", match: nil)
1707+
firstMatchTest(re, input: "⛔️:X ", match: nil)
1708+
1709+
firstMatchTest(re, input: "⛔️·X ", match: nil)
1710+
firstMatchTest(re, input: "⛔️:X ", match: nil)
1711+
}
1712+
16861713
func testMatchGroups() {
16871714
// Must have new stdlib for character class ranges and word boundaries.
16881715
guard ensureNewStdlib() else { return }

0 commit comments

Comments
 (0)