Skip to content

Commit b048159

Browse files
authored
[Test] More word breaking tests (#703)
1 parent 71f8d49 commit b048159

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Tests/RegexTests/MatchTests.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,33 @@ extension RegexTests {
17771777
firstMatchTest(#"\b÷\b"#, input: "3 ÷ 3 = 1", match: "÷")
17781778
}
17791779

1780+
func testLevel2WordBoundaries_negative() throws {
1781+
// Run some non-match cases, the latter of which used to hang
1782+
1783+
// FIXME: stdlib 5.10 check
1784+
1785+
let re = #"\bA\b"#
1786+
1787+
firstMatchTest(re, input: "⛔️: X ", match: nil)
1788+
firstMatchTest(re, input: "\u{FE0F}: X ", match: nil)
1789+
firstMatchTest(re, input: "👨‍👨‍👧‍👦\u{FE0F}: X ", match: nil)
1790+
1791+
firstMatchTest(re, input: "Z:X ", match: nil)
1792+
1793+
firstMatchTest(re, input: "Z\u{FE0F}:X ", match: nil)
1794+
firstMatchTest(re, input: "è\u{FE0F}:X ", match: nil)
1795+
1796+
firstMatchTest(re, input: "日:X ", match: nil)
1797+
firstMatchTest(re, input: "👨‍👨‍👧‍👦:X ", match: nil)
1798+
1799+
firstMatchTest(re, input: "\u{FE0F}:X ", match: nil)
1800+
firstMatchTest(re, input: "👨‍👨‍👧‍👦\u{FE0F}:X ", match: nil)
1801+
firstMatchTest(re, input: "⛔️:X ", match: nil)
1802+
1803+
firstMatchTest(re, input: "⛔️·X ", match: nil)
1804+
firstMatchTest(re, input: "⛔️:X ", match: nil)
1805+
}
1806+
17801807
func testMatchGroups() {
17811808
// Must have new stdlib for character class ranges and word boundaries.
17821809
guard ensureNewStdlib() else { return }

0 commit comments

Comments
 (0)