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:
Andrew Trick
2017-03-16 19:27:06 -07:00
parent 534ec7ed87
commit da0c4db530
9 changed files with 170 additions and 87 deletions

View File

@@ -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)
}
}