Check UniqueDeque with checkDrainableContainer

Run the drainable container checker against UniqueDeque over every
storage layout, including wrapped ones. UniqueDeque's own remove(at:),
removeSubrange(_:) and consumeSubrange(_:consumingWith:) don't match
the protocol's requirements, since the first takes its index by value
and the others return nothing, so the checker's generic calls reach the
protocol's default implementations of these, over a two-part storage.
It passes with #814's fix reverted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Joseph CursioandClaude Opus 5.5 committed 2026-11-03 19:16:49 -06:00
1 parent b0a4a44eeb
commit ffd6fe4a3f
1 file changed
+9
+9
View File
@@ -128,6 +128,15 @@ final class UniqueDequeTests: CollectionTestCase {
}
}
@available(SwiftStdlib 6.4, *)
func test_validate_DrainableContainer() {
withEveryDeque("layout", ofCapacities: [0, 1, 2, 3, 5]) { layout in
checkDrainableContainer(count: layout.count) { contents in
UniqueDeque(layout: layout) { contents[$0] }
}
}
}
@available(SwiftStdlib 6.4, *)
func test_validate_MutableContainer() {
withEveryDeque("layout", ofCapacities: [0, 1, 2, 3, 5, 10]) { layout in