Files
swift-collections/Tests
Joseph D CursioandClaude Opus 5 fe2b083fae [DequeModule] Add tests for Deque's storage allocation behavior
#113 switched `append(contentsOf:)` to exponential capacity reservation
without adding tests. This covers Deque's allocation behavior:

- Implement the empty `test_reserveCapacity` stub: reservations grow
  storage linearly to exactly the requested capacity, never shrink it,
  and leave sufficiently large unique storage in place.
- Initializers with a known element count allocate exactly that much.
- Single-element insertions follow the same capacity sequence as
  `UniqueDeque`.
- Repeated bulk insertions (append/prepend/insert/replaceSubrange, from
  contiguous arrays, collections and sequences) grow storage by a
  constant factor rather than reallocating on each call.
- Reserved capacity is used without reallocating.
- Inserting into shared storage keeps capacity when there is room and
  otherwise grows it by the same factor, leaving the original untouched.

Resolves #129.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NTKVRe3aXMteHVrhbrTYE
2026-09-13 13:55:10 -05:00
..

Unit tests

Beware! The contents of this directory are not source stable. They are provided as is, with no compatibility promises across package releases. Future versions of this package can arbitrarily change these files or remove them, without any advance notice. (This can include patch releases.)