Skip to content

Commit 1718734

Browse files
author
Lance Parker
committed
Make the NormalizationCheck test compare code units
1 parent fc3341e commit 1718734

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

validation-test/stdlib/String.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,10 +2190,12 @@ StringTests.test("NormalizationBufferCrashRegressionTest") {
21902190
expectTrue(set.contains(str))
21912191
}
21922192

2193-
StringTests.test("NormalizationSanityCheck") {
2193+
StringTests.test("NormalizationCheck") {
21942194
let str = "\u{0336}\u{0344}\u{0357}\u{0343}\u{0314}\u{0351}\u{0340}\u{0300}\u{0340}\u{0360}\u{0314}\u{0357}\u{0315}\u{0301}\u{0344}a"
2195-
let strNFC = "\u{0336}\u{0308}\u{0301}\u{0357}\u{0313}\u{0314}\u{0351}\u{0300}\u{0300}\u{0300}\u{0314}\u{0357}\u{0301}\u{0308}\u{0301}\u{0315}\u{0360}\u{0061}"
2196-
expectEqual(str, strNFC)
2195+
let nfcCodeUnits = str._nfcCodeUnits
2196+
let expectedCodeUnits: [UInt8] = [0xCC, 0xB6, 0xCC, 0x88, 0xCC, 0x81, 0xCD, 0x97, 0xCC, 0x93, 0xCC, 0x94, 0xCD, 0x91, 0xCC, 0x80, 0xCC, 0x80, 0xCC, 0x80, 0xCC, 0x94, 0xCD, 0x97, 0xCC, 0x81, 0xCC, 0x88, 0xCC, 0x81, 0xCC, 0x95, 0xCD, 0xA0, 0x61]
2197+
2198+
expectEqual(expectedCodeUnits, nfcCodeUnits)
21972199
}
21982200

21992201
runAllTests()

0 commit comments

Comments
 (0)