mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix and enable testing stdlib Collection instances.
Top-level entry points fully testing a collection instance:
check${Traversal}Collection
One level of recursion into all slices of the collection instance
O(n^2). (Not combinatorial).
Previously, checkCollection() did nothing. So much of the testing infrastructure was inactive. Now it runs all forward collection tests.
Fixes a bug in subscriptRangeTests.
The UnsafeRawBufferPointer and Data collection testing is disabled and
will be fixed in the following commit.
This commit is contained in:
@@ -1607,7 +1607,7 @@ func checkUTF8View(_ expected: [UInt8], _ subject: String,
|
||||
|
||||
func checkUTF16View(_ expected: [UInt16], _ subject: String,
|
||||
_ stackTrace: SourceLocStack) {
|
||||
checkSliceableWithBidirectionalIndex(expected, subject.utf16)
|
||||
checkBidirectionalCollection(expected, subject.utf16)
|
||||
}
|
||||
|
||||
func forStringsWithUnpairedSurrogates(_ checkClosure: (UTF16Test, String) -> Void) {
|
||||
@@ -1848,7 +1848,7 @@ StringCookedViews.test("UnicodeScalars").forEach(in: utfTests) {
|
||||
test in
|
||||
|
||||
let subject = NonContiguousNSString(test.utf32) as String
|
||||
checkSliceableWithBidirectionalIndex(
|
||||
checkBidirectionalCollection(
|
||||
test.unicodeScalars, subject.unicodeScalars)
|
||||
}
|
||||
|
||||
@@ -1858,7 +1858,7 @@ StringCookedViews.test("UnicodeScalars/StringsWithUnpairedSurrogates") {
|
||||
let expectedScalars = (test.scalarsHead + test.scalarsRepairedTail).map {
|
||||
UnicodeScalar($0)!
|
||||
}
|
||||
checkSliceableWithBidirectionalIndex(
|
||||
checkBidirectionalCollection(
|
||||
expectedScalars, subject.unicodeScalars)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user