mirror of
https://github.com/apple/swift-collections
synced 2026-11-27 04:54:21 +00:00
Run random sequences of operations on RigidSet, UniqueSet, RigidDictionary and UniqueDictionary, and after each step compare them against a standard Set/Dictionary model: count, contents (via index iteration), positive and negative lookups, and `_checkInvariants()`. The operations cover insert/update/remove, the closure form of `updateValue(forKey:with:)`, `memoizedValue(forKey:_:)`, `reallocate`/ `reserveCapacity`, `removeAll` (with and without keeping capacity), Rigid <-> Unique conversions via `init(consuming:)`, and `_consumeAll`. Keys use a configurable number of distinct hash values, from no collisions down to a single collision chain, and all elements are lifetime-tracked to catch leaks and double destroys. These tests found the bugs fixed in #835 and #836.