-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathArray_RangeReplaceableRandomAccessCollectionRef.swift
43 lines (30 loc) · 1.33 KB
/
Array_RangeReplaceableRandomAccessCollectionRef.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//===----------------------------------------------------------------------===//
// 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("Array_RangeReplaceableRandomAccessCollectionRef")
do {
var resiliencyChecks = CollectionMisuseResiliencyChecks.all
resiliencyChecks.creatingOutOfBoundsIndicesBehavior = .none
// Test RangeReplaceableCollectionType conformance with reference type elements.
tests.addRangeReplaceableRandomAccessCollectionTests(
"Array.",
makeCollection: { (elements: [LifetimeTracked]) in
return Array(elements)
},
wrapValue: { (element: OpaqueValue<Int>) in LifetimeTracked(element.value) },
extractValue: { (element: LifetimeTracked) in OpaqueValue(element.value) },
makeCollectionOfEquatable: { (elements: [MinimalEquatableValue]) in
// FIXME: use LifetimeTracked.
return Array(elements)
},
wrapValueIntoEquatable: identityEq,
extractValueFromEquatable: identityEq,
resiliencyChecks: resiliencyChecks)
} // do
runAllTests()