@@ -501,7 +501,6 @@ extension RegexTests {
501
501
parseTest ( #"[[:a]]"# , charClass ( charClass ( " : " , " a " ) ) )
502
502
parseTest ( #"[[:}]]"# , charClass ( charClass ( " : " , " } " ) ) )
503
503
parseTest ( #"[[:{]]"# , charClass ( charClass ( " : " , " { " ) ) )
504
- parseTest ( #"[[:{:]]"# , charClass ( posixProp_m ( . other( key: nil , value: " { " ) ) ) )
505
504
parseTest ( #"[[:}:]]"# , charClass ( charClass ( " : " , " } " , " : " ) ) )
506
505
507
506
parseTest (
@@ -1141,14 +1140,6 @@ extension RegexTests {
1141
1140
#"\p{C}+"# ,
1142
1141
oneOrMore ( of: prop ( . generalCategory( . other) ) ) )
1143
1142
1144
- // TODO: Start erroring on these?
1145
- parseTest ( #"\p{Lx}"# , prop ( . other( key: nil , value: " Lx " ) ) )
1146
- parseTest ( #"\p{gcL}"# , prop ( . other( key: nil , value: " gcL " ) ) )
1147
- parseTest ( #"\p{x=y}"# , prop ( . other( key: " x " , value: " y " ) ) )
1148
- parseTest ( #"\p{aaa(b)}"# , prop ( . other( key: nil , value: " aaa(b) " ) ) )
1149
- parseTest ( " [[:a():]] " , charClass ( posixProp_m ( . other( key: nil , value: " a() " ) ) ) )
1150
- parseTest ( #"\p{aaa\p{b}}"# , concat ( prop ( . other( key: nil , value: #"aaa\p{b"# ) ) , " } " ) )
1151
-
1152
1143
// UAX44-LM3 means all of the below are equivalent.
1153
1144
let lowercaseLetter = prop ( . generalCategory( . lowercaseLetter) )
1154
1145
parseTest ( #"\p{ll}"# , lowercaseLetter)
@@ -2231,12 +2222,12 @@ extension RegexTests {
2231
2222
diagnosticTest ( #"\x{5"# , . expected( " } " ) )
2232
2223
diagnosticTest ( #"\N{A"# , . expected( " } " ) )
2233
2224
diagnosticTest ( #"\N{U+A"# , . expected( " } " ) )
2234
- diagnosticTest ( #"\p{a"# , . expected ( " } " ) )
2225
+ diagnosticTest ( #"\p{a"# , . unknownProperty ( key : nil , value : " a " ) )
2235
2226
diagnosticTest ( #"\p{a="# , . emptyProperty)
2236
2227
diagnosticTest ( #"\p{a=}"# , . emptyProperty)
2237
- diagnosticTest ( #"\p{a=b"# , . expected ( " } " ) )
2238
- diagnosticTest ( #"\p{aaa[b]}"# , . expected ( " } " ) )
2239
- diagnosticTest ( #"\p{a=b=c}"# , . expected ( " } " ) )
2228
+ diagnosticTest ( #"\p{a=b"# , . unknownProperty ( key : " a " , value : " b " ) )
2229
+ diagnosticTest ( #"\p{aaa[b]}"# , . unknownProperty ( key : nil , value : " aaa " ) )
2230
+ diagnosticTest ( #"\p{a=b=c}"# , . unknownProperty ( key : " a " , value : " b " ) )
2240
2231
diagnosticTest ( #"(?#"# , . expected( " ) " ) )
2241
2232
diagnosticTest ( #"(?x"# , . expected( " ) " ) )
2242
2233
@@ -2321,6 +2312,16 @@ extension RegexTests {
2321
2312
diagnosticTest ( #"\\#u{E9}"# , . invalidEscape( " é " ) )
2322
2313
diagnosticTest ( #"\˂"# , . invalidEscape( " ˂ " ) )
2323
2314
2315
+ // MARK: Character properties
2316
+
2317
+ diagnosticTest ( #"\p{Lx}"# , . unknownProperty( key: nil , value: " Lx " ) )
2318
+ diagnosticTest ( #"\p{gcL}"# , . unknownProperty( key: nil , value: " gcL " ) )
2319
+ diagnosticTest ( #"\p{x=y}"# , . unknownProperty( key: " x " , value: " y " ) )
2320
+ diagnosticTest ( #"\p{aaa(b)}"# , . unknownProperty( key: nil , value: " aaa(b) " ) )
2321
+ diagnosticTest ( " [[:a():]] " , . unknownProperty( key: nil , value: " a() " ) )
2322
+ diagnosticTest ( #"\p{aaa\p{b}}"# , . unknownProperty( key: nil , value: #"aaa\p{b"# ) )
2323
+ diagnosticTest ( #"[[:{:]]"# , . unknownProperty( key: nil , value: " { " ) )
2324
+
2324
2325
// MARK: Matching options
2325
2326
2326
2327
diagnosticTest ( " (?-y{g}) " , . cannotRemoveTextSegmentOptions)
0 commit comments