@@ -1629,33 +1629,36 @@ extension RegexTests {
1629
1629
#"\d{3}(?<!USD\d{3})"# , input: " Price: JYP100 " , match: " 100 " )
1630
1630
1631
1631
firstMatchTest ( #"(?<=abc)def"# , input: " abcdefg " , match: " def " )
1632
- firstMatchTests (
1633
- #"(?<=az|b|c)def"# ,
1634
- ( " azdefg " , " def " ) ,
1635
- ( " bdefg " , " def " ) ,
1636
- ( " cdefg " , " def " ) ,
1637
- ( " 123defg " , nil ) ,
1638
- validateOptimizations: false
1639
- )
1640
-
1641
- firstMatchTest ( #"abcd(?<=bc(?=d).)"# , input: " abcdefg " , match: " abcd " )
1632
+ firstMatchTests (
1633
+ #"(?<=az|b|c)def"# ,
1634
+ ( " azdefg " , " def " ) ,
1635
+ ( " bdefg " , " def " ) ,
1636
+ ( " cdefg " , " def " ) ,
1637
+ ( " 123defg " , nil )
1638
+ )
1642
1639
1643
1640
// FIXME: quickMatch and thoroughMatch have different results
1644
1641
// firstMatchTest(
1645
1642
// #"(?<=\d{1,3}-.{1,3}-\d{1,3})suffix"#,
1646
1643
// input: "123-_+/-789suffix",
1647
- // match: "suffix",
1648
- // validateOptimizations: false
1644
+ // match: "suffix"
1649
1645
// )
1650
1646
1651
- firstMatchTests (
1652
- #"(?<=^\d{1,3})abc"# ,
1653
- ( " 123abc " , " abc " ) ,
1654
- ( " 12abc " , " abc " ) ,
1655
- ( " 1abc " , " abc " ) ,
1656
- ( " 1234abc " , nil ) , // FIXME: Shouldn't match but does because `^` assertions are broken
1657
- ( " z123abc " , nil ) // FIXME: Same as above
1658
- )
1647
+ firstMatchTests (
1648
+ #"(?<=^\d{1,3})abc"# ,
1649
+ ( " 123abc " , " abc " ) ,
1650
+ ( " 12abc " , " abc " ) ,
1651
+ ( " 1abc " , " abc " ) ,
1652
+ ( " 1234abc " , nil ) , // FIXME: Shouldn't match but does because `^` assertions are broken
1653
+ ( " z123abc " , nil ) // FIXME: Same as above
1654
+ )
1655
+
1656
+ firstMatchTest ( #"abcd(?<=c(?=d)d)"# , input: " abcdefg " , match: " abcd " )
1657
+ firstMatchTest ( #"abcd(?<=cd(?=d).)"# , input: " abcdefg " , match: nil )
1658
+ firstMatchTest ( #"abcd(?<=c(?=e)d)"# , input: " abcdefg " , match: nil )
1659
+ firstMatchTest ( #"abcd(?<=bc(?=d).)"# , input: " abcdefg " , match: " abcd " )
1660
+ firstMatchTest ( #"abcd(?<=bc(?=de)d)"# , input: " abcdefg " , match: " abcd " )
1661
+ firstMatchTest ( #"abcd(?<=bc(?=de).)"# , input: " abcdefg " , match: " abcd " )
1659
1662
}
1660
1663
1661
1664
func testMatchAnchors( ) throws {
0 commit comments