mirror of
https://github.com/apple/swift-collections
synced 2026-11-27 04:54:21 +00:00
Check RigidArray with checkMutableContainer
Run the mutable container checker, which also runs the bidirectional one, against RigidArray. With #793's nextMutableSpan fix reverted, it fails with the index not advancing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2d14dcdff9
commit
bfc228d7b7
1 file changed
+13
@@ -87,6 +87,19 @@ class RigidArrayTests: CollectionTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
func test_validate_MutableContainer() {
|
||||
withSomeArrayLayouts("layout", ofCapacities: [0, 10, 100]) { layout in
|
||||
withLifetimeTracking { tracker in
|
||||
var items = tracker.rigidArray(layout: layout)
|
||||
let expected = (0 ..< layout.count).map { tracker.instance(for: $0) }
|
||||
checkMutableContainer(&items, expectedContents: expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
func test_empty() {
|
||||
let a = RigidArray<Int>()
|
||||
expectEqual(a.capacity, 0)
|
||||
|
||||
Reference in new issue
Block a user