@@ -1683,6 +1683,33 @@ extension RegexTests {
1683
1683
firstMatchTest ( #"\b÷\b"# , input: " 3 ÷ 3 = 1 " , match: " ÷ " )
1684
1684
}
1685
1685
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
+
1686
1713
func testMatchGroups( ) {
1687
1714
// Must have new stdlib for character class ranges and word boundaries.
1688
1715
guard ensureNewStdlib ( ) else { return }
0 commit comments