From 55e96453165520c313eb44a8095f063307238b77 Mon Sep 17 00:00:00 2001 From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com> Date: Sun, 16 Jun 2024 15:20:07 +0100 Subject: [PATCH] Rewrite tests to allow being run in parallel (#80) --- Consumer/TestValues.fs | 44 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/Consumer/TestValues.fs b/Consumer/TestValues.fs index 8402d77..6a80762 100644 --- a/Consumer/TestValues.fs +++ b/Consumer/TestValues.fs @@ -86,14 +86,42 @@ module TestValues = [] let ``Values are all OK`` () = - seen1 |> Seq.toList |> shouldEqual [ true ; false ] - seen2 |> Seq.toList |> shouldEqual [ (true, false) ; (false, true) ] - seen3 |> Seq.toList |> shouldEqual [ (88, box 29) ; (31, box 0) ] - seen4 |> Seq.toList |> shouldEqual [ ("hi", box "ohh") ; ("bye", null) ] - seen5 |> Seq.toList |> shouldEqual [ (88, box 29) ; (31, box 29) ] - seen6 |> Seq.toList |> shouldEqual [ ("hi", box "ohh") ; ("bye", box "ohh") ] - seen7 |> Seq.toList |> shouldEqual [ (88, box 29) ; (31, box 29) ] - seen8 |> Seq.toList |> shouldEqual [ ("hi", box "ohh") ; ("bye", box "ohh") ] + seen1 |> Seq.toList |> List.sort |> shouldEqual [ false ; true ] + + seen2 + |> Seq.toList + |> List.sort + |> shouldEqual [ (false, true) ; (true, false) ] + + seen3 + |> Seq.toList + |> List.sortBy fst + |> shouldEqual [ (31, box 0) ; (88, box 29) ] + + seen4 + |> Seq.toList + |> List.sortBy fst + |> shouldEqual [ ("bye", null) ; ("hi", box "ohh") ] + + seen5 + |> Seq.toList + |> List.sortBy fst + |> shouldEqual [ (31, box 29) ; (88, box 29) ] + + seen6 + |> Seq.toList + |> List.sortBy fst + |> shouldEqual [ ("bye", box "ohh") ; ("hi", box "ohh") ] + + seen7 + |> Seq.toList + |> List.sortBy fst + |> shouldEqual [ (31, box 29) ; (88, box 29) ] + + seen8 + |> Seq.toList + |> List.sortBy fst + |> shouldEqual [ ("bye", box "ohh") ; ("hi", box "ohh") ] seen9 |> Seq.toList