You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 41308a1
Browse filesBrowse the repository at this point in the historyBrowse files
fixup! test: shared contracts of the set modules, run for HashSet and ISet
Tests of the gaps of the sets report (package A4), 2843 per target framework:
- `SetMutationOps` gets `AddRange`, `RemoveRange` and `OfSeqByRemainder`, and
`SetCreationOps` and `SetCustomComparerOps` get `OfReadOnlySpan` and `OfSpan`, one
field for each function. `SortedSet` derives the tests of the mutation and creation
contracts with these fields.
- `SetMutationContract` runs `addRange` and `removeRange` with an array, a list and a lazy
sequence over every pair of inputs, against `Set.union` and `Set.difference`, and with a
comparer by remainder, where the elements of the set stay and the first of the other
elements of each remainder is added (D14). The input itself must come back when the
sequence adds nothing or removes nothing, under both comparers, and a null sequence
throws `ArgumentNullException` with the name `elements`.
- `SetCreationContract` runs `ofReadOnlySpan` and `ofSpan` of the module and of the struct on
a copy of each input that the test changes after the call. `SetInputs` gets the row
sources of the pairs that add or remove nothing, and `Remainders`, which `SetContract`
uses too.
- `HashSetTests` pins the first of the equal elements of a span through the table of the
struct, `addRange` of an empty hash set (`Union` answers it with another instance), the
comparer of an empty input that receives a hash set with another comparer, and `ofSeq` of
the struct for an equal but distinct comparer instance. The tables of the comparer, the
creation functions and the null checks list the new functions. `HashSetBuilderTests`
covers `build`, the `build` of the struct and `update`, and `ISetTests` the
implementation and the comparer kept by `addRange` and `removeRange`.
Each new behavior was broken once in the code, 25 mutations, and a test failed each time.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
0 commit comments