mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
50 lines
1.5 KiB
Swift
50 lines
1.5 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("ContiguousArray_MutableRandomAccessCollectionVal")
|
|
|
|
|
|
|
|
do {
|
|
var resiliencyChecks = CollectionMisuseResiliencyChecks.all
|
|
resiliencyChecks.creatingOutOfBoundsIndicesBehavior = .none
|
|
|
|
|
|
// Test MutableCollectionType conformance with value type elements.
|
|
tests.addMutableRandomAccessCollectionTests(
|
|
"ContiguousArray.",
|
|
makeCollection: { (elements: [OpaqueValue<Int>]) in
|
|
return ContiguousArray(elements)
|
|
},
|
|
wrapValue: identity,
|
|
extractValue: identity,
|
|
makeCollectionOfEquatable: { (elements: [MinimalEquatableValue]) in
|
|
return ContiguousArray(elements)
|
|
},
|
|
wrapValueIntoEquatable: identityEq,
|
|
extractValueFromEquatable: identityEq,
|
|
makeCollectionOfComparable: { (elements: [MinimalComparableValue]) in
|
|
return ContiguousArray(elements)
|
|
},
|
|
wrapValueIntoComparable: identityComp,
|
|
extractValueFromComparable: identityComp,
|
|
resiliencyChecks: resiliencyChecks,
|
|
withUnsafeMutableBufferPointerIsSupported: true,
|
|
isFixedLengthCollection: false)
|
|
|
|
|
|
} // do
|
|
|
|
runAllTests()
|
|
|