Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Tests/RegexTests/UTS18Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ extension UTS18Tests {
// Test \v - vertical space
lines = lineInput.matches(of: regex(#"\d{2}\v^"#).anchorsMatchLineEndings())
XCTAssertEqual(lines.count, 11)
// Test \s - whitespace
lines = lineInput.matches(of: regex(#"\d{2}\s^"#).anchorsMatchLineEndings())
XCTAssertEqual(lines.count, 11)
// Test anchors as line boundaries
lines = lineInput.matches(of: regex(#"^\d{2}$"#).anchorsMatchLineEndings())
XCTAssertEqual(lines.count, 12)
Expand All @@ -301,6 +304,10 @@ extension UTS18Tests {
lines = lineInput.matches(
of: regex(#"\d{2}\v(?=\d)"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings())
XCTAssertEqual(lines.count, 10)
// Unicode scalar semantics - \s matches all except for \r\n sequence
lines = lineInput.matches(
of: regex(#"\d{2}\s(?=\d)"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings())
XCTAssertEqual(lines.count, 10)

// Does not contain an empty line
XCTAssertFalse(lineInput.contains(regex(#"^$"#)))
Expand Down