Skip to content

Commit 241f155

Browse files
committed
print("1")
1 parent 6034a90 commit 241f155

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Tests/RegexTests/UTS18Tests.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ extension UTS18Tests {
270270
09\u{85}\
271271
10\u{2028}\
272272
11\u{2029}\
273-
273+
12
274274
"""
275275
// Check the input counts
276276
var lines = lineInput.matches(of: regex(#"\d{2}"#))
277-
XCTAssertEqual(lines.count, 11)
277+
XCTAssertEqual(lines.count, 12)
278278
// Test \R - newline sequence
279279
lines = lineInput.matches(of: regex(#"\d{2}\R^"#).anchorsMatchLineEndings())
280280
XCTAssertEqual(lines.count, 11)
@@ -283,21 +283,29 @@ extension UTS18Tests {
283283
XCTAssertEqual(lines.count, 11)
284284
// Test anchors as line boundaries
285285
lines = lineInput.matches(of: regex(#"^\d{2}$"#).anchorsMatchLineEndings())
286-
XCTAssertEqual(lines.count, 11)
286+
XCTAssertEqual(lines.count, 12)
287287
// Test that dot does not match line endings
288288
lines = lineInput.matches(of: regex(#".+"#))
289-
XCTAssertEqual(lines.count, 11)
289+
XCTAssertEqual(lines.count, 12)
290290

291291
// Unicode scalar semantics - \R still matches all, including \r\n sequence
292292
lines = lineInput.matches(
293293
of: regex(#"\d{2}\R^"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings())
294294
XCTAssertEqual(lines.count, 11)
295+
lines = lineInput.matches(
296+
of: regex(#"\d{2}\R(?=\d)"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings())
297+
XCTAssertEqual(lines.count, 11)
295298
XCTAssertNotNil(lineInput.firstMatch(
296299
of: regex(#"08\R^"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings()))
297300
// Unicode scalar semantics - \v matches all except for \r\n sequence
301+
print("\n\n\n-------", #line, "\n\n\n")
298302
lines = lineInput.matches(
299303
of: regex(#"\d{2}\v^"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings())
300304
XCTAssertEqual(lines.count, 10)
305+
print("\n\n\n-------", #line, "\n\n\n")
306+
lines = lineInput.matches(
307+
of: regex(#"\d{2}\v(?=\d)"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings())
308+
XCTAssertEqual(lines.count, 10)
301309
XCTAssertNil(lineInput.firstMatch(
302310
of: regex(#"08\v^"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings()))
303311

0 commit comments

Comments
 (0)