Skip to content

Commit e4e946b

Browse files
xperiandriclaude
andcommitted
fixup! test: SortedSet against the set contracts and the order of Set
The assertion helpers are static classes since the foundation reached `main`. The four calls in `SortedSetTests` and `SortedSetOptionTests` use `ExceptionAssert.Same` and `OverrideAssert.OptionMatches` with tupled arguments. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 2841b65 commit e4e946b

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

‎tests/FSharp.Collections.Immutable.Tests/SortedSet/SortedSetOptionTests.fs‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@ type SortedSetOptionTests () =
2828
member _.``tryGetValue returns an option`` (value : int) =
2929
let found : int option = SortedSet.tryGetValue value numbers
3030

31-
OverrideAssert.optionMatches
32-
(FSharp.Collections.Immutable.SortedSet.tryGetValue value numbers)
33-
found
31+
OverrideAssert.OptionMatches (
32+
FSharp.Collections.Immutable.SortedSet.tryGetValue value numbers,
33+
found,
3434
"Option.SortedSet.tryGetValue must match the default"
35+
)
3536

3637
[<TestMethod; DynamicData(nameof SortedSetOptionTests.Indices)>]
3738
member _.``tryItem returns an option`` (index : int) =
3839
let found : int option = SortedSet.tryItem index numbers
3940

40-
OverrideAssert.optionMatches
41-
(FSharp.Collections.Immutable.SortedSet.tryItem index numbers)
42-
found
41+
OverrideAssert.OptionMatches (
42+
FSharp.Collections.Immutable.SortedSet.tryItem index numbers,
43+
found,
4344
"Option.SortedSet.tryItem must match the default"
45+
)
4446

4547
[<TestMethod>]
4648
member _.``choose takes a chooser of options`` () =

‎tests/FSharp.Collections.Immutable.Tests/SortedSet/SortedSetTests.fs‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -868,19 +868,21 @@ type SortedSetTests () =
868868

869869
[<TestMethod>]
870870
member _.``minElement throws for an empty sorted set as Set does`` () =
871-
ExceptionAssert.same
872-
SortedSetOps.paramName
873-
(fun () -> Set.minElement Set.empty<int> |> ignore)
874-
(fun () -> SortedSet.minElement SortedSet.empty<int> |> ignore)
871+
ExceptionAssert.Same (
872+
SortedSetOps.paramName,
873+
(fun () -> Set.minElement Set.empty<int> |> ignore),
874+
(fun () -> SortedSet.minElement SortedSet.empty<int> |> ignore),
875875
"SortedSet.minElement of an empty sorted set must throw"
876+
)
876877

877878
[<TestMethod>]
878879
member _.``maxElement throws for an empty sorted set as Set does`` () =
879-
ExceptionAssert.same
880-
SortedSetOps.paramName
881-
(fun () -> Set.maxElement Set.empty<int> |> ignore)
882-
(fun () -> SortedSet.maxElement SortedSet.empty<int> |> ignore)
880+
ExceptionAssert.Same (
881+
SortedSetOps.paramName,
882+
(fun () -> Set.maxElement Set.empty<int> |> ignore),
883+
(fun () -> SortedSet.maxElement SortedSet.empty<int> |> ignore),
883884
"SortedSet.maxElement of an empty sorted set must throw"
885+
)
884886

885887
// ---- Null inputs ----
886888

0 commit comments

Comments
 (0)