Commit Graph
47 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
Karoy Lorentey 8b8a14f0e1 Merge pull request #340 from vanvoorden/vanvoorden/ordered-set-equality
[OrderedSet] forward ordered set equality to elements property
2023-12-12 21:54:30 -05: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 VoordenandKaroy Lorentey d2662892cd remove extra ordered dictionary elements test
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2023-12-12 11:18:50 -08:00
Rick van VoordenandKaroy Lorentey baa3880e6e add ordered dictionary test for equal identity
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2023-12-12 11:17:06 -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
Rick van Voorden e42fb868b7 forward ordered dictionary values equality to values property 2023-12-08 17:39:25 -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 a2f4b18ae0 [BitSet, OrderedCollections] Unify UnsafeBitSet implementations 2022-11-28 16:30:55 -08: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
Karoy Lorentey 6437aea75a [PersistentCollections] Improve test coverage & fixtures 2022-09-27 14:18:40 -07:00
Karoy Lorentey b7bfc52664 [test] Add Dictionary API checker protocol
This can be used to verify that a new dictionary implementation
provides all expected members.
2022-09-19 21:25:07 -07:00
Karoy Lorentey 9a9d7d87d8 Merge branch 'release/1.0'
# Conflicts:
#	.swiftpm/xcode/xcshareddata/xcschemes/swift-collections-Package.xcscheme
#	Utils/swift-collections.xcworkspace/xcshareddata/xcschemes/Collections.xcscheme
#	Utils/swift-collections.xcworkspace/xcshareddata/xcschemes/OrderedCollections.xcscheme
#	Utils/swift-collections.xcworkspace/xcshareddata/xcschemes/swift-collections-Package.xcscheme
2022-09-02 15:30:31 -07:00
Karoy Lorentey 71aa4a39ae [OrderedDictionary] Resolve spurious(?) call-site ambiguities 2022-08-31 17:57:24 -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
Karoy Lorentey 50e6a1ac71 [OrderedDictionary] Fix type inference issue with OrderedDictionary.init(grouping:by:)
This adds a new overload to help the type checker infer `[S.Element]` as the default `Value` type.

Resolves #139.
2022-02-08 14:16:18 -08: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 9d4bb8cdf8 [OrderedDictionary] Remove deprecated API
Mark the deprecated `subscript(offset:)` and `modifyValue(...)` APIs unavailable and replace their bodies with fatalError().
2021-09-03 19:11:29 -07: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
Karoy Lorentey 9d8719c8be [OrderedDictionary] Deprecate subscript(offset:) for now (#92)
* [OrderedDictionary] Deprecate index(forKey:), subscript(offset:) and friends for now

* [OrderedDictionary] Update tests

* Update benchmarks

* Un-deprecate index(forKey:)
2021-08-19 19:26:41 -07:00
Karoy Lorentey 1e68069c98 [OrderedDictionary] modifyValue → updateValue (#91)
* [OrderedDictionary] modifyValue → updateValue

* Update CMakeLists.txt
2021-08-19 19:26:41 -07:00
Andrew Monshizadeh f1c6cb4a4f Mark OrderedSetDiffingTests with availability (#54) 2021-06-21 10:42:49 -07:00
Michael Steindorfer fe745fc2e8 [OrderedCollections] Correct spelling of BitsetTests filename (#29) 2021-04-29 20:19:51 -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