mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
fix the normalization unit tests
This commit is contained in:
committed by
Michael Ilseman
parent
7aea40680d
commit
bacc7eecd5
@@ -18,16 +18,12 @@ import StdlibUnittest
|
||||
import StdlibUnicodeUnittest
|
||||
|
||||
private func expectEqualIterators(expected: [UInt8], others: [[UInt8]]) {
|
||||
expected.withUnsafeBufferPointer { expectedBuffer in
|
||||
for other in others {
|
||||
other.withUnsafeBufferPointer { otherBuffer in
|
||||
let expectedIterator =
|
||||
_NormalizedUTF8CodeUnitIterator(expectedBuffer, range: 0..<expectedBuffer.count)
|
||||
let otherIterator =
|
||||
_NormalizedUTF8CodeUnitIterator(otherBuffer, range: 0..<otherBuffer.count)
|
||||
expectEqual(Array(expectedIterator), Array(otherIterator))
|
||||
}
|
||||
}
|
||||
let expectedString = String(decoding: expected, as: UTF8.self)
|
||||
let expectedCodeUnits = expectedString._nfcCodeUnits
|
||||
|
||||
for other in others {
|
||||
let otherString = String(decoding: other, as: UTF8.self)
|
||||
expectEqual(expectedCodeUnits, otherString._nfcCodeUnits)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user