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 {
286286 // Test \v - vertical space
287287 lines = lineInput. matches ( of: regex ( #"\d{2}\v^"# ) . anchorsMatchLineEndings ( ) )
288288 XCTAssertEqual ( lines. count, 11 )
289+ // Test \s - whitespace
290+ lines = lineInput. matches ( of: regex ( #"\d{2}\s^"# ) . anchorsMatchLineEndings ( ) )
291+ XCTAssertEqual ( lines. count, 11 )
289292 // Test anchors as line boundaries
290293 lines = lineInput. matches ( of: regex ( #"^\d{2}$"# ) . anchorsMatchLineEndings ( ) )
291294 XCTAssertEqual ( lines. count, 12 )
@@ -301,6 +304,10 @@ extension UTS18Tests {
301304 lines = lineInput. matches (
302305 of: regex ( #"\d{2}\v(?=\d)"# ) . matchingSemantics ( . unicodeScalar) . anchorsMatchLineEndings ( ) )
303306 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 )
304311
305312 // Does not contain an empty line
306313 XCTAssertFalse ( lineInput. contains ( regex ( #"^$"# ) ) )
You can’t perform that action at this time.
0 commit comments