Files
swift-mirror/validation-test/stdlib/Array/ArraySlice_RangeReplaceableRandomAccessCollectionRef.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

43 lines
1.3 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("ArraySlice_RangeReplaceableRandomAccessCollectionRef")
do {
var resiliencyChecks = CollectionMisuseResiliencyChecks.all
resiliencyChecks.creatingOutOfBoundsIndicesBehavior = .none
// Test RangeReplaceableCollectionType conformance with reference type elements.
tests.addRangeReplaceableRandomAccessSliceTests(
"ArraySlice.",
makeCollection: { (elements: [LifetimeTracked]) in
return ArraySlice(elements)
},
wrapValue: { (element: OpaqueValue<Int>) in LifetimeTracked(element.value) },
extractValue: { (element: LifetimeTracked) in OpaqueValue(element.value) },
makeCollectionOfEquatable: { (elements: [MinimalEquatableValue]) in
// FIXME: use LifetimeTracked.
return ArraySlice(elements)
},
wrapValueIntoEquatable: identityEq,
extractValueFromEquatable: identityEq,
resiliencyChecks: resiliencyChecks)
} // do
runAllTests()