mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
Run the bidirectional container checker against BidirectionalContainer's default implementations. With #793's formIndex(_:offsetBy:limitedBy:) fix reverted, it fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
1.2 KiB
Swift
37 lines
1.2 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift Collections open source project
|
|
//
|
|
// Copyright (c) 2026 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
import XCTest
|
|
#if COLLECTIONS_SINGLE_MODULE
|
|
import Collections
|
|
#else
|
|
import _CollectionsTestSupport
|
|
import BasicContainers
|
|
#endif
|
|
import ContainersPreview
|
|
|
|
#if compiler(>=6.4) && UnstableContainersPreview
|
|
@available(SwiftStdlib 6.4, *)
|
|
final class BidirectionalContainerTests: CollectionTestCase {
|
|
func test_validate_BidirectionalContainer() {
|
|
withEvery("count", in: [0, 1, 2, 10]) { count in
|
|
withLifetimeTracking { tracker in
|
|
let expected = tracker.instances(for: 0 ..< count)
|
|
let items = MinimalBidirectionalContainer(RigidArray(copying: expected))
|
|
checkBidirectionalContainer(items, expectedContents: expected)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endif
|