Files
swift-mirror/validation-test/stdlib/Array/ArraySlice_RangeReplaceableRandomAccessCollectionRef.swift
Erik Eckstein 0831240be6 tests: disable COW checking by default, and enable it for specific tests
COW checking needs that all libraries are consistently compiled with asserts enabled. This is not the case for the Foundation overlay anymore.
Therefore it does not work with some tests which interop with Foundation.

The solution here is to disable COW checking by default, but enable it for Array tests which do not interop with Foundation.
2021-06-17 16:14:03 +02:00

44 lines
1.3 KiB
Swift

//===----------------------------------------------------------------------===//
// Automatically Generated From validation-test/stdlib/Array/Inputs/ArrayConformanceTests.swift.gyb
// Do Not Edit Directly!
//===----------------------------------------------------------------------===//
// RUN: %enable-cow-checking %target-run-simple-swift
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
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()