Files
swift-mirror/validation-test/stdlib/Array/ArraySliceWithNonZeroStartIndex_MutableRandomAccessCollectionVal.swift
Max Moiseev a552cd45e5 [validation-test] Extracting array and slice types conformance tests
Since these tests take the most time, spliting them into 'one type -
one conformance' pairs to maximize parallelism.

<rdar://problem/30269532>
2017-02-07 11:58:47 -08:00

55 lines
1.7 KiB
Swift

//===----------------------------------------------------------------------===//
// Automatically Generated From validation-test/stdlib/Array/Inputs/ArrayConformanceTests.swift.gyb
// Do Not Edit Directly!
//===----------------------------------------------------------------------===//
// RUN: %target-run-simple-swift
// REQUIRES: executable_test
import StdlibUnittest
import StdlibCollectionUnittest
let tests = TestSuite("ArraySliceWithNonZeroStartIndex_MutableRandomAccessCollectionVal")
func ArraySliceWithNonZeroStartIndex<T>(_ elements: [T]) -> ArraySlice<T> {
var r = ArraySlice<T>(_startIndex: 1000)
r.append(contentsOf: elements)
expectEqual(1000, r.startIndex)
return r
}
do {
var resiliencyChecks = CollectionMisuseResiliencyChecks.all
resiliencyChecks.creatingOutOfBoundsIndicesBehavior = .none
// Test MutableCollectionType conformance with value type elements.
tests.addMutableRandomAccessCollectionTests(
"ArraySliceWithNonZeroStartIndex.",
makeCollection: { (elements: [OpaqueValue<Int>]) in
return ArraySliceWithNonZeroStartIndex(elements)
},
wrapValue: identity,
extractValue: identity,
makeCollectionOfEquatable: { (elements: [MinimalEquatableValue]) in
return ArraySliceWithNonZeroStartIndex(elements)
},
wrapValueIntoEquatable: identityEq,
extractValueFromEquatable: identityEq,
makeCollectionOfComparable: { (elements: [MinimalComparableValue]) in
return ArraySliceWithNonZeroStartIndex(elements)
},
wrapValueIntoComparable: identityComp,
extractValueFromComparable: identityComp,
resiliencyChecks: resiliencyChecks,
withUnsafeMutableBufferPointerIsSupported: true,
isFixedLengthCollection: false)
} // do
runAllTests()