File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,9 @@ extension UTS18Tests {
286
286
// Test \v - vertical space
287
287
lines = lineInput. matches ( of: regex ( #"\d{2}\v^"# ) . anchorsMatchLineEndings ( ) )
288
288
XCTAssertEqual ( lines. count, 11 )
289
+ // Test \s - whitespace
290
+ lines = lineInput. matches ( of: regex ( #"\d{2}\s^"# ) . anchorsMatchLineEndings ( ) )
291
+ XCTAssertEqual ( lines. count, 11 )
289
292
// Test anchors as line boundaries
290
293
lines = lineInput. matches ( of: regex ( #"^\d{2}$"# ) . anchorsMatchLineEndings ( ) )
291
294
XCTAssertEqual ( lines. count, 12 )
@@ -301,6 +304,10 @@ extension UTS18Tests {
301
304
lines = lineInput. matches (
302
305
of: regex ( #"\d{2}\v(?=\d)"# ) . matchingSemantics ( . unicodeScalar) . anchorsMatchLineEndings ( ) )
303
306
XCTAssertEqual ( lines. count, 10 )
307
+ // Unicode scalar semantics - \s matches all except for \r\n sequence
308
+ lines = lineInput. matches (
309
+ of: regex ( #"\d{2}\s(?=\d)"# ) . matchingSemantics ( . unicodeScalar) . anchorsMatchLineEndings ( ) )
310
+ XCTAssertEqual ( lines. count, 10 )
304
311
305
312
// Does not contain an empty line
306
313
XCTAssertFalse ( lineInput. contains ( regex ( #"^$"# ) ) )
You can’t perform that action at this time.
0 commit comments