Commit Graph
33 Commits
Author SHA1 Message Date
Guillaume Lessard 3f6522fef1 post-rebase compatibility fixes 2024-10-06 11:16:43 -07:00
Karoy Lorentey 35d5746117 Rename _CollectionsUtilities to InternalCollectionsUtilities
We are forced to do this due to an Xcode issue (#364) with underscored module names.

This module remains unstable, despite the removal of the underscore. Directly importing it from outside the package remains unsupported. This module and/or its entire contents may go away or change in incompatible ways in any future swift-collections release.
2024-05-29 14:00:13 -07:00
Karoy Lorentey ffa4a58bc1 Update remaining copyright notices 2024-02-02 16:20:22 -08:00
Karoy Lorentey 1a0ac8c06c Merge branch 'release/1.0' into release/1.1
# Conflicts:
#	Sources/DequeModule/CMakeLists.txt
#	Sources/DequeModule/Deque+Collection.swift
#	Sources/DequeModule/Deque+Sendable.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sendable.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sequence.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift
#	Sources/OrderedCollections/OrderedSet/OrderedSet+Sendable.swift
#	Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift
#	Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift
#	Sources/OrderedCollections/OrderedSet/OrderedSet+UnstableInternals.swift
2023-12-21 15:17:15 -08:00
Rick van Voorden 525bb545c4 clean up ordered set equality test 2023-12-12 14:00:00 -08:00
Rick van Voorden 00ccf9a1c0 remove ordered set print statements 2023-12-12 12:31:14 -08:00
Rick van Voorden 0031fc7e36 update ordered set subsequence tests 2023-12-12 12:30:14 -08:00
Rick van VoordenandKaroy Lorentey 88404c3ae8 test through ordered set subsequences
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2023-12-12 11:38:24 -08:00
Rick van Voorden ba88bcad62 updated set equality tests 2023-12-11 17:40:12 -08:00
Rick van Voorden edb431ee36 add set equality tests 2023-12-11 15:46:59 -08:00
Karoy Lorentey 09c09f0f73 Fix CustomStringConvertible/CustomDebugStringConvertible conformances
- For CustomStringConvertible, `description` should print elements using `String(reflecting:)` rather than `String(describing:)`, to avoid element output from interfering with syntactically relevant punctuation within structured list displays.
- To make this work without making displays overly verbose, make `debugDescription` mostly the same as `description`, except for escaping raw string displays when and if needed.
- Avoid printing type names in `debugDescription` — it is generally not helpful, as the type is already easily accessible elsewhere. Including it makes for overly verbose displays when the type serves as an Element of a collection.
- Avoid having `debugDescription` return the empty string — it can be confusing when such a description appears in list displays.

Resolves #301.
2023-07-06 17:25:11 -07:00
Karoy Lorentey a0666cdcce Resolve some leftover build issues 2023-03-23 14:23:45 -07:00
Karoy Lorentey f17cf642c1 Add support building with COLLECTIONS_SINGLE_MODULE
- Sources/_CollectionsTestSupport → Tests/_CollectionsTestSupport
- Refactor Package.swift to allow switching between the default
   polymodule and the new monomodule product configurations
   (by editing the manifest file).
- Fix build errors in the monomodule variant.
2023-03-22 21:44:23 -07:00
Karoy Lorentey ea60d293b4 Fix test issues with single-module variant 2023-03-21 18:43:46 -07:00
Karoy Lorentey cbab9e3737 Introduce COLLECTIONS_SINGLE_MODULE condition 2023-03-21 18:42:33 -07:00
Karoy Lorentey 8f7d5fd505 [SetAlgebra types] isEqual(to:) → isEqualSet(to:)
The `isEqual(to:)` methods are a bit too confusing — they implement
mathematical set comparisons (ignoring element ordering and, in the
case of the Sequence variant, even element multiplicities), so it
seems better to highlight this by putting a `Set` in the name.
2022-10-31 15:05:12 -07:00
Karoy Lorentey 2dae70dba7 [OrderedSet, BitSet] Fix display style of custom mirror 2022-10-27 18:29:32 -07:00
Karoy Lorentey 0914e6f546 [OrderedSet] More test coverage for set operations; clarify docs 2022-10-21 18:24:08 -07:00
Karoy Lorentey 7143421800 [OrderedCollections] Add missing Custom[Debug]StringConvertable conformances, review existing ones
Add `Custom[Debug]StringConvertible` conformance on:

- `OrderedDictionary.Values`
- `OrderedDictionary.Elements.Subsequence`
- `OrderedSet.SubSequence`
2022-10-20 17:14:52 -07:00
Karoy Lorentey 5dfd51238c [OrderedSet] Review, test, fix, and document set relation predicates 2022-10-19 15:20:30 -07:00
Karoy Lorentey 4604c1bc38 [test] Add SetAPIChecker protocol
This is useful for validating the API surface of set-like types,
ensuring that we haven’t forgotten to implement members that
are part of users’ baseline expectations.

To ensure maximum utility, this protocol refines neither Collection
nor SetAlgebra.
2022-10-09 13:33:23 -07:00
Konrad `ktoso` Malawski 876586f924 expect type is correct 2022-08-17 11:06:07 +09:00
Konrad `ktoso` Malawski 4138ccd68e improve test to cover more cases 2022-08-17 11:01:07 +09:00
Konrad `ktoso` Malawski 6142869b83 +OrderedSet add filter #158 2022-08-16 20:37:44 +09:00
Károly Lőrentey 13b5889757 [OrderedCollections][test] Strengthen withHiddenCopies tests
`withHiddenCopies(if:of:)` is supposed to check for value semantic violations where mutations of one copy affect another -- however, it currently only checks that iteration returns the same items before/after the change, not that the old copy is still in a fully consistent state.

Add an extra parameter that can be set to a closure that performs stricter checks.

Use it to call `_checkInvariants()` in ordered collections tests, uncovering a missing uniqueness check in `OrderedSet._insertNew(_:at:in:)`.
2021-11-11 00:39:29 -08:00
Karoy Lorentey f1f48d569a [test] CollectionsTestSupport → _CollectionsTestSupport
The underscored module name makes it clear that this isn't public API.
2021-09-03 15:57:09 -07:00
Andrew Monshizadeh f1c6cb4a4f Mark OrderedSetDiffingTests with availability (#54) 2021-06-21 10:42:49 -07:00
Scott Perry fcaad7a824 Myers worst case performance tests 2021-04-05 20:29:17 -07:00
Scott Perry d3ab8e8536 Performance testing and diff size checks, along with fuzzer test demonstrating greedy minimalism tradeoff 2021-04-05 20:24:22 -07:00
Scott Perry 7401c23c18 Basic implementation of OrderedSet.applying() balancing performance with code complexity 2021-04-05 19:19:28 -07:00
Scott Perry c71b73954e Match style 2021-04-05 19:07:03 -07:00
Scott Perry ed375766aa Initial implementation of diffing (and tests!) for OrderedSet 2021-04-05 18:35:23 -07:00
Karoy Lorentey a2bcac435f Initial import.
Introduce OrderedCollections module
2021-04-05 09:41:00 -07:00