|
| 1 | +// -*- swift -*- |
| 2 | + |
| 3 | +//===----------------------------------------------------------------------===// |
| 4 | +// Automatically Generated From validation-test/stdlib/Collection/Inputs/Template.swift.gyb |
| 5 | +// Do Not Edit Directly! |
| 6 | +//===----------------------------------------------------------------------===// |
| 7 | + |
| 8 | +// RUN: %target-run-simple-swift |
| 9 | +// REQUIRES: executable_test |
| 10 | + |
| 11 | +import StdlibUnittest |
| 12 | +import StdlibCollectionUnittest |
| 13 | + |
| 14 | +var CollectionTests = TestSuite("Collection") |
| 15 | + |
| 16 | +// Test collections using a reference type as element. |
| 17 | +do { |
| 18 | + var resiliencyChecks = CollectionMisuseResiliencyChecks.all |
| 19 | + resiliencyChecks.creatingOutOfBoundsIndicesBehavior = .trap |
| 20 | + |
| 21 | + CollectionTests.addMutableBidirectionalCollectionTests( |
| 22 | + makeCollection: { (elements: [LifetimeTracked]) in |
| 23 | + return DefaultedMutableBidirectionalCollection(elements: elements) |
| 24 | + }, |
| 25 | + wrapValue: { (element: OpaqueValue<Int>) in |
| 26 | + LifetimeTracked(element.value, identity: element.identity) |
| 27 | + }, |
| 28 | + extractValue: { (element: LifetimeTracked) in |
| 29 | + OpaqueValue(element.value, identity: element.identity) |
| 30 | + }, |
| 31 | + makeCollectionOfEquatable: { (elements: [MinimalEquatableValue]) in |
| 32 | + // FIXME: use LifetimeTracked. |
| 33 | + return DefaultedMutableBidirectionalCollection(elements: elements) |
| 34 | + }, |
| 35 | + wrapValueIntoEquatable: identityEq, |
| 36 | + extractValueFromEquatable: identityEq, |
| 37 | + makeCollectionOfComparable: { (elements: [MinimalComparableValue]) in |
| 38 | + // FIXME: use LifetimeTracked. |
| 39 | + return DefaultedMutableBidirectionalCollection(elements: elements) |
| 40 | + }, |
| 41 | + wrapValueIntoComparable: identityComp, |
| 42 | + extractValueFromComparable: identityComp, |
| 43 | + resiliencyChecks: resiliencyChecks |
| 44 | + , withUnsafeMutableBufferPointerIsSupported: false, |
| 45 | + isFixedLengthCollection: true |
| 46 | + ) |
| 47 | +} |
| 48 | + |
| 49 | +runAllTests() |
0 commit comments