Skip to content

Commit e71ac84

Browse files
committed
print("here")
1 parent 3a9e9e1 commit e71ac84

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Tests/RegexTests/UTS18Tests.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ import XCTest
2222
@testable // for internal `matches(of:)`
2323
import _StringProcessing
2424

25+
extension UnicodeScalar {
26+
var value4Digits: String {
27+
let valueString = String(value, radix: 16, uppercase: true)
28+
if valueString.count >= 4 { return valueString }
29+
return String(repeating: "0", count: 4 - valueString.count) + valueString
30+
}
31+
}
32+
2533
class UTS18Tests: XCTestCase {
2634
var input: String {
2735
"ABCdefghîøu\u{308}\u{FFF0} -–—[]123"
@@ -293,6 +301,16 @@ extension UTS18Tests {
293301
XCTAssertNil(lineInput.firstMatch(
294302
of: regex(#"08\v^"#).matchingSemantics(.unicodeScalar).anchorsMatchLineEndings()))
295303

304+
XCTAssertNotNil(lineInput.firstMatch(of: regex(#"08\u{d}\u{a}"#).matchingSemantics(.unicodeScalar)))
305+
XCTAssertNotNil(lineInput.firstMatch(
306+
of: regex(#"08..09"#).matchingSemantics(.unicodeScalar).dotMatchesNewlines()))
307+
308+
for _ in 0..<10 { print("---") }
309+
for (i, s) in lineInput.unicodeScalars.enumerated() {
310+
print("\(i): scalar U+\(s.value4Digits)")
311+
}
312+
for _ in 0..<10 { print("---") }
313+
296314
// Does not contain an empty line
297315
XCTAssertFalse(lineInput.contains(regex(#"^$"#)))
298316
// Does contain an empty line (between \n and \r, which are reversed here)

0 commit comments

Comments
 (0)