File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,8 @@ func firstMatchTest(
169
169
XCTAssertEqual ( found, match, file: file, line: line)
170
170
}
171
171
} catch {
172
+ // FIXME: This allows non-matches to succeed even when xfail'd
173
+ // When xfail == true, this should report failure for match == nil
172
174
if !xfail && match != nil {
173
175
XCTFail ( " \( error) " , file: file, line: line)
174
176
}
@@ -182,7 +184,9 @@ func firstMatchTests(
182
184
syntax: SyntaxOptions = . traditional,
183
185
enableTracing: Bool = false ,
184
186
dumpAST: Bool = false ,
185
- xfail: Bool = false
187
+ xfail: Bool = false ,
188
+ file: StaticString = #filePath,
189
+ line: UInt = #line
186
190
) {
187
191
for (input, match) in tests {
188
192
firstMatchTest (
@@ -192,7 +196,9 @@ func firstMatchTests(
192
196
syntax: syntax,
193
197
enableTracing: enableTracing,
194
198
dumpAST: dumpAST,
195
- xfail: xfail)
199
+ xfail: xfail,
200
+ file: file,
201
+ line: line)
196
202
}
197
203
}
198
204
@@ -483,6 +489,24 @@ extension RegexTests {
483
489
( " baaaaaaaabc " , nil ) ,
484
490
( " bb " , nil ) )
485
491
492
+ // XFAIL'd possessive tests
493
+ firstMatchTests (
494
+ " a?+a " ,
495
+ ( " a " , nil ) ,
496
+ xfail: true )
497
+ firstMatchTests (
498
+ " (a|a)?+a " ,
499
+ ( " a " , nil ) ,
500
+ xfail: true )
501
+ firstMatchTests (
502
+ " (a|a){2,4}+a " ,
503
+ ( " a " , nil ) ,
504
+ ( " aa " , nil ) )
505
+ firstMatchTests (
506
+ " (a|a){2,4}+a " ,
507
+ ( " aaa " , nil ) ,
508
+ ( " aaaa " , nil ) ,
509
+ xfail: true )
486
510
487
511
firstMatchTests (
488
512
" (?:a{2,4}?b)+ " ,
You can’t perform that action at this time.
0 commit comments