Skip to content

Commit 6d27790

Browse files
committed
print("1")
1 parent 6034a90 commit 6d27790

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Tests/RegexTests/UTS18Tests.swift

Lines changed: 15 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,20 +283,31 @@ 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())
304+
305+
print(lines.map { "\n\n```\($0.0)```\n\n" }.joined())
306+
307+
XCTAssertEqual(lines.count, 10)
308+
print("\n\n\n-------", #line, "\n\n\n")
309+
lines = lineInput.matches(
310+
of: regex(#"\d{2}\v(?=\d)"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings())
300311
XCTAssertEqual(lines.count, 10)
301312
XCTAssertNil(lineInput.firstMatch(
302313
of: regex(#"08\v^"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings()))

0 commit comments

Comments
 (0)