From 5cae63af0a14116ceb46ae2508e47d916891e4e3 Mon Sep 17 00:00:00 2001 From: Matthew Lutze Date: Wed, 14 Jan 2026 09:31:46 +0100 Subject: [PATCH] squish --- test/Test/Property/TestListSet.flix | 43 +- test/Test/TestListSet.flix | 1192 +++++++++++++-------------- 2 files changed, 608 insertions(+), 627 deletions(-) diff --git a/test/Test/Property/TestListSet.flix b/test/Test/Property/TestListSet.flix index 701478e..51a2b52 100644 --- a/test/Test/Property/TestListSet.flix +++ b/test/Test/Property/TestListSet.flix @@ -20,64 +20,45 @@ mod JonathanStarup.Test.Property.TestListSet { use Abort.abort use Formattable.format - def runCrash(f: Unit -> Unit \ ef): Bool \ ef + IO - Abort = - run {f(); true} with handler Abort { - def abort(msg, _) = { - println("Test failed: ${msg}"); - false - } - } - - def _assertEq(x: t, y: t): Unit \ Abort with Eq[t], ToString[t] = { - if (x == y) () - else abort(format("${x} != ${y}")) - } - - def assertExpect(expect: {expect = t}, actual: t): Unit \ Abort with Eq[t], ToString[t] = { - if (expect#expect == actual) () - else abort(format("found ${actual} but expected ${expect#expect}")) - } - def runTest( - tests: Int32, seed: Int64, prop: c -> Unit \ Abort - ): Bool \ IO + (Collectable.Aef[c] - Abort - Random) + tests: Int32, seed: Int64, prop: c -> Unit \ Assert + ): Unit \ Assert + (Collectable.Aef[c] - Random) with Collectable[c] where Collectable.Elm[c] ~ Int32 = region local { let f = () -> ListSetGenerator.randomIterator(local, tests) |> Iterator.forEach(prop); - let g = () -> runCrash(f); - Random.runWithSeed(seed, g) + Random.runWithSeed(seed, f) } - @test - pub def testEmpty(): Bool \ IO = { + @Test + pub def testEmpty(): Unit \ Assert = { def prop(l) = { let expectedLength = List.isEmpty(l); let s = ListSet.fromIterable(l); - ListSet.isEmpty(s) |> assertExpect(expect = expectedLength) + ListSet.isEmpty(s) |> Assert.assertEq(expected = expectedLength) }; prop |> runTest(100, 8168590i64) } - @test - pub def testSize(): Bool \ IO = { + @Test + pub def testSize(): Unit \ Assert = { def prop(l) = { let expectedLength = List.length(l); let s = ListSet.fromIterable(l); - ListSet.size(s) |> assertExpect(expect = expectedLength) + ListSet.size(s) |> Assert.assertEq(expected = expectedLength) }; prop |> runTest(10_000, 578956838i64) } - @test - pub def testInsertRedundant(): Bool \ IO = { + @Test + pub def testInsertRedundant(): Unit \ Assert = { def prop(l) = { let s1 = ListSet.fromIterable(l); let s2 = l |> List.head |> Option.map(hd -> ListSet.insert(hd, s1)) |> Option.getWithDefault(s1); - assertExpect(expect = s1, s2) + Assert.assertEq(expected = s1, s2) }; prop |> runTest(1_000, -6859625i64) } diff --git a/test/Test/TestListSet.flix b/test/Test/TestListSet.flix index 464b506..4b0ee3f 100644 --- a/test/Test/TestListSet.flix +++ b/test/Test/TestListSet.flix @@ -27,913 +27,913 @@ mod JonathanStarup.Test.TestListSet { ///////////////////////////////////////////////////////////////////////////// // Collectable.collect // ///////////////////////////////////////////////////////////////////////////// - @test - def collect01(): Bool = region rc { - Collectable.collect((Iterator.empty(rc): Iterator[Int32, rc, rc])) == ListSet.empty() + @Test + def collect01(): Unit \ Assert = region rc { + Assert.assertEq(expected = ListSet.empty(), Collectable.collect((Iterator.empty(rc): Iterator[Int32, rc, rc]))) } - @test - def collect02(): Bool = region rc { - Collectable.collect(Iterator.singleton(rc, 1)) == ListSet.singleton(1) + @Test + def collect02(): Unit \ Assert = region rc { + Assert.assertEq(expected = ListSet.singleton(1), Collectable.collect(Iterator.singleton(rc, 1))) } - @test - def collect03(): Bool = region rc { - Collectable.collect(Iterator.range(rc, 1, 3)) == ListSet.fromIterable(List#{1, 2}) + @Test + def collect03(): Unit \ Assert = region rc { + Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2}), Collectable.collect(Iterator.range(rc, 1, 3))) } ///////////////////////////////////////////////////////////////////////////// // size // ///////////////////////////////////////////////////////////////////////////// - @test - def size01(): Bool = ListSet.size((ListSet.empty(): ListSet[Int32])) == 0 + @Test + def size01(): Unit \ Assert = Assert.assertEq(expected = 0, ListSet.size((ListSet.empty(): ListSet[Int32]))) - @test - def size02(): Bool = ListSet.size(ListSet.singleton(1)) == 1 + @Test + def size02(): Unit \ Assert = Assert.assertEq(expected = 1, ListSet.size(ListSet.singleton(1))) - @test - def size03(): Bool = ListSet.size(ListSet.fromIterable(List#{1, 2})) == 2 + @Test + def size03(): Unit \ Assert = Assert.assertEq(expected = 2, ListSet.size(ListSet.fromIterable(List#{1, 2}))) - @test - def size04(): Bool = ListSet.size(ListSet.fromIterable(List#{1, 2, 3})) == 3 + @Test + def size04(): Unit \ Assert = Assert.assertEq(expected = 3, ListSet.size(ListSet.fromIterable(List#{1, 2, 3}))) - @test - def size05(): Bool = ListSet.size(ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14})) == 13 + @Test + def size05(): Unit \ Assert = Assert.assertEq(expected = 13, ListSet.size(ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14}))) ///////////////////////////////////////////////////////////////////////////// // empty // ///////////////////////////////////////////////////////////////////////////// - @test - def empty01(): Bool = (ListSet.empty(): ListSet[Unit]) == ListSet.empty() + @Test + def empty01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), (ListSet.empty(): ListSet[Unit])) ///////////////////////////////////////////////////////////////////////////// // singleton // ///////////////////////////////////////////////////////////////////////////// - @test - def singleton01(): Bool = ListSet.singleton(1) == ListSet.singleton(1) + @Test + def singleton01(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.singleton(1)) - @test - def singleton02(): Bool = ListSet.singleton(2) == ListSet.singleton(2) + @Test + def singleton02(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(2), ListSet.singleton(2)) - @test - def singleton03(): Bool = ListSet.singleton(true) == ListSet.fromIterable(List#{true}) + @Test + def singleton03(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{true}), ListSet.singleton(true)) - @test - def singleton04(): Bool = ListSet.singleton(false) == ListSet.fromIterable(List#{false}) + @Test + def singleton04(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{false}), ListSet.singleton(false)) ///////////////////////////////////////////////////////////////////////////// // insert // ///////////////////////////////////////////////////////////////////////////// - @test - def insert01(): Bool = ListSet.insert(1, ListSet.empty()) == ListSet.singleton(1) + @Test + def insert01(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.insert(1, ListSet.empty())) - @test - def insert02(): Bool = ListSet.insert(1, ListSet.singleton(1)) == ListSet.singleton(1) + @Test + def insert02(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.insert(1, ListSet.singleton(1))) - @test - def insert03(): Bool = ListSet.insert(1, ListSet.singleton(2)) == ListSet.fromIterable(List#{1, 2}) + @Test + def insert03(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2}), ListSet.insert(1, ListSet.singleton(2))) - @test - def insert04(): Bool = ListSet.insert(1, ListSet.fromIterable(List#{2, 3})) == ListSet.fromIterable(List#{1, 2, 3}) + @Test + def insert04(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3}), ListSet.insert(1, ListSet.fromIterable(List#{2, 3}))) - @test - def insert05(): Bool = ListSet.insert(1, ListSet.fromIterable(List#{1, 2, 3})) == ListSet.fromIterable(List#{1, 2, 3}) + @Test + def insert05(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3}), ListSet.insert(1, ListSet.fromIterable(List#{1, 2, 3}))) - @test - def insert06(): Bool = ListSet.insert(1, ListSet.fromIterable(List#{2, 1, 3})) == ListSet.fromIterable(List#{2, 1, 3}) + @Test + def insert06(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{2, 1, 3}), ListSet.insert(1, ListSet.fromIterable(List#{2, 1, 3}))) - @test - def insert07(): Bool = ListSet.insert(1, ListSet.fromIterable(List#{2, 1, 3, 7, 8, 9, 10})) == ListSet.fromIterable(List#{2, 1, 3, 7, 8, 9, 10}) + @Test + def insert07(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{2, 1, 3, 7, 8, 9, 10}), ListSet.insert(1, ListSet.fromIterable(List#{2, 1, 3, 7, 8, 9, 10}))) - @test - def insert08(): Bool = ListSet.insert(11, ListSet.fromIterable(List#{2, 1, 3, 7, 8, 9, 10, 35})) == ListSet.fromIterable(List#{11, 2, 1, 3, 7, 8, 9, 10, 35}) + @Test + def insert08(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{11, 2, 1, 3, 7, 8, 9, 10, 35}), ListSet.insert(11, ListSet.fromIterable(List#{2, 1, 3, 7, 8, 9, 10, 35}))) ///////////////////////////////////////////////////////////////////////////// // remove // ///////////////////////////////////////////////////////////////////////////// - @test - def remove01(): Bool = ListSet.remove(1, ListSet.empty()) == ListSet.empty() + @Test + def remove01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.remove(1, ListSet.empty())) - @test - def remove02(): Bool = ListSet.remove(1, ListSet.singleton(1)) == ListSet.empty() + @Test + def remove02(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.remove(1, ListSet.singleton(1))) - @test - def remove03(): Bool = ListSet.remove(1, ListSet.singleton(2)) == ListSet.singleton(2) + @Test + def remove03(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(2), ListSet.remove(1, ListSet.singleton(2))) - @test - def remove04(): Bool = ListSet.remove(2, ListSet.fromIterable(List#{2, 3})) == ListSet.singleton(3) + @Test + def remove04(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(3), ListSet.remove(2, ListSet.fromIterable(List#{2, 3}))) - @test - def remove05(): Bool = ListSet.remove(3, ListSet.fromIterable(List#{2, 3})) == ListSet.singleton(2) + @Test + def remove05(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(2), ListSet.remove(3, ListSet.fromIterable(List#{2, 3}))) - @test - def remove06(): Bool = ListSet.remove(1, ListSet.fromIterable(List#{2, 3})) == ListSet.fromIterable(List#{2, 3}) + @Test + def remove06(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{2, 3}), ListSet.remove(1, ListSet.fromIterable(List#{2, 3}))) - @test - def remove07(): Bool = ListSet.remove(0, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7})) == ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}) + @Test + def remove07(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}), ListSet.remove(0, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}))) - @test - def remove08(): Bool = ListSet.remove(1, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7})) == ListSet.fromIterable(List#{2, 3, 4, 5, 6, 7}) + @Test + def remove08(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{2, 3, 4, 5, 6, 7}), ListSet.remove(1, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}))) - @test - def remove09(): Bool = ListSet.remove(2, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7})) == ListSet.fromIterable(List#{1, 3, 4, 5, 6, 7}) + @Test + def remove09(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 3, 4, 5, 6, 7}), ListSet.remove(2, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}))) - @test - def remove10(): Bool = ListSet.remove(6, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7})) == ListSet.fromIterable(List#{1, 2, 3, 4, 5, 7}) + @Test + def remove10(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3, 4, 5, 7}), ListSet.remove(6, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}))) - @test - def remove11(): Bool = ListSet.remove(7, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7})) == ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6}) + @Test + def remove11(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6}), ListSet.remove(7, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}))) - @test - def remove12(): Bool = ListSet.remove(8, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7})) == ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}) + @Test + def remove12(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}), ListSet.remove(8, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7}))) ///////////////////////////////////////////////////////////////////////////// // isEmpty // ///////////////////////////////////////////////////////////////////////////// - @test - def isEmpty01(): Bool = ListSet.isEmpty((ListSet.empty(): ListSet[Unit])) == true + @Test + def isEmpty01(): Unit \ Assert = Assert.assertTrue(ListSet.isEmpty((ListSet.empty(): ListSet[Unit]))) - @test - def isEmpty02(): Bool = ListSet.isEmpty(ListSet.singleton(1)) == false + @Test + def isEmpty02(): Unit \ Assert = Assert.assertFalse(ListSet.isEmpty(ListSet.singleton(1))) - @test - def isEmpty03(): Bool = ListSet.isEmpty(ListSet.fromIterable(List#{1, 2})) == false + @Test + def isEmpty03(): Unit \ Assert = Assert.assertFalse(ListSet.isEmpty(ListSet.fromIterable(List#{1, 2}))) - @test - def isEmpty04(): Bool = ListSet.isEmpty(ListSet.fromIterable(List#{1, 2, 3})) == false + @Test + def isEmpty04(): Unit \ Assert = Assert.assertFalse(ListSet.isEmpty(ListSet.fromIterable(List#{1, 2, 3}))) - @test - def isEmpty05(): Bool = ListSet.isEmpty(ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8})) == false + @Test + def isEmpty05(): Unit \ Assert = Assert.assertFalse(ListSet.isEmpty(ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8}))) ///////////////////////////////////////////////////////////////////////////// // nonEmpty // ///////////////////////////////////////////////////////////////////////////// - @test - def nonEmpty01(): Bool = ListSet.nonEmpty((ListSet.empty(): ListSet[Unit])) == false + @Test + def nonEmpty01(): Unit \ Assert = Assert.assertFalse(ListSet.nonEmpty((ListSet.empty(): ListSet[Unit]))) - @test - def nonEmpty02(): Bool = ListSet.nonEmpty(ListSet.singleton(1)) == true + @Test + def nonEmpty02(): Unit \ Assert = Assert.assertTrue(ListSet.nonEmpty(ListSet.singleton(1))) - @test - def nonEmpty03(): Bool = ListSet.nonEmpty(ListSet.fromIterable(List#{1, 2})) == true + @Test + def nonEmpty03(): Unit \ Assert = Assert.assertTrue(ListSet.nonEmpty(ListSet.fromIterable(List#{1, 2}))) - @test - def nonEmpty04(): Bool = ListSet.nonEmpty(ListSet.fromIterable(List#{1, 2, 3})) == true + @Test + def nonEmpty04(): Unit \ Assert = Assert.assertTrue(ListSet.nonEmpty(ListSet.fromIterable(List#{1, 2, 3}))) - @test - def nonEmpty05(): Bool = ListSet.nonEmpty(ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8})) == true + @Test + def nonEmpty05(): Unit \ Assert = Assert.assertTrue(ListSet.nonEmpty(ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8}))) ///////////////////////////////////////////////////////////////////////////// // memberOf // ///////////////////////////////////////////////////////////////////////////// - @test - def memberOf01(): Bool = ListSet.memberOf(1, ListSet.empty()) == false + @Test + def memberOf01(): Unit \ Assert = Assert.assertFalse(ListSet.memberOf(1, ListSet.empty())) - @test - def memberOf02(): Bool = ListSet.memberOf(1, ListSet.singleton(2)) == false + @Test + def memberOf02(): Unit \ Assert = Assert.assertFalse(ListSet.memberOf(1, ListSet.singleton(2))) - @test - def memberOf03(): Bool = ListSet.memberOf(1, ListSet.singleton(1)) == true + @Test + def memberOf03(): Unit \ Assert = Assert.assertTrue(ListSet.memberOf(1, ListSet.singleton(1))) - @test - def memberOf04(): Bool = ListSet.memberOf(1, ListSet.fromIterable(List#{1, 2})) == true + @Test + def memberOf04(): Unit \ Assert = Assert.assertTrue(ListSet.memberOf(1, ListSet.fromIterable(List#{1, 2}))) - @test - def memberOf05(): Bool = ListSet.memberOf(2, ListSet.fromIterable(List#{1, 2})) == true + @Test + def memberOf05(): Unit \ Assert = Assert.assertTrue(ListSet.memberOf(2, ListSet.fromIterable(List#{1, 2}))) - @test - def memberOf06(): Bool = ListSet.memberOf(0, ListSet.fromIterable(List#{1, 2})) == false + @Test + def memberOf06(): Unit \ Assert = Assert.assertFalse(ListSet.memberOf(0, ListSet.fromIterable(List#{1, 2}))) - @test - def memberOf07(): Bool = ListSet.memberOf(3, ListSet.fromIterable(List#{1, 2})) == false + @Test + def memberOf07(): Unit \ Assert = Assert.assertFalse(ListSet.memberOf(3, ListSet.fromIterable(List#{1, 2}))) - @test - def memberOf08(): Bool = ListSet.memberOf(0, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == false + @Test + def memberOf08(): Unit \ Assert = Assert.assertFalse(ListSet.memberOf(0, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def memberOf09(): Bool = ListSet.memberOf(1, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == true + @Test + def memberOf09(): Unit \ Assert = Assert.assertTrue(ListSet.memberOf(1, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def memberOf10(): Bool = ListSet.memberOf(2, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == true + @Test + def memberOf10(): Unit \ Assert = Assert.assertTrue(ListSet.memberOf(2, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def memberOf11(): Bool = ListSet.memberOf(10, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == true + @Test + def memberOf11(): Unit \ Assert = Assert.assertTrue(ListSet.memberOf(10, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def memberOf12(): Bool = ListSet.memberOf(12, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == false + @Test + def memberOf12(): Unit \ Assert = Assert.assertFalse(ListSet.memberOf(12, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) ///////////////////////////////////////////////////////////////////////////// // isSubsetOf // ///////////////////////////////////////////////////////////////////////////// - @test - def isSubsetOf01(): Bool = ListSet.isSubsetOf((ListSet.empty(): ListSet[Unit]), ListSet.empty()) == true + @Test + def isSubsetOf01(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf((ListSet.empty(): ListSet[Unit]), ListSet.empty())) - @test - def isSubsetOf02(): Bool = ListSet.isSubsetOf(ListSet.empty(), ListSet.singleton(1)) == true + @Test + def isSubsetOf02(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.empty(), ListSet.singleton(1))) - @test - def isSubsetOf03(): Bool = ListSet.isSubsetOf(ListSet.singleton(1), ListSet.singleton(1)) == true + @Test + def isSubsetOf03(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.singleton(1), ListSet.singleton(1))) - @test - def isSubsetOf04(): Bool = ListSet.isSubsetOf(ListSet.singleton(1), ListSet.singleton(2)) == false + @Test + def isSubsetOf04(): Unit \ Assert = Assert.assertFalse(ListSet.isSubsetOf(ListSet.singleton(1), ListSet.singleton(2))) - @test - def isSubsetOf05(): Bool = ListSet.isSubsetOf(ListSet.empty(), ListSet.fromIterable(List#{1, 2})) == true + @Test + def isSubsetOf05(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.empty(), ListSet.fromIterable(List#{1, 2}))) - @test - def isSubsetOf06(): Bool = ListSet.isSubsetOf(ListSet.singleton(1), ListSet.fromIterable(List#{1, 2})) == true + @Test + def isSubsetOf06(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.singleton(1), ListSet.fromIterable(List#{1, 2}))) - @test - def isSubsetOf07(): Bool = ListSet.isSubsetOf(ListSet.singleton(2), ListSet.fromIterable(List#{1, 2})) == true + @Test + def isSubsetOf07(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.singleton(2), ListSet.fromIterable(List#{1, 2}))) - @test - def isSubsetOf08(): Bool = ListSet.isSubsetOf(ListSet.singleton(3), ListSet.fromIterable(List#{1, 2})) == false + @Test + def isSubsetOf08(): Unit \ Assert = Assert.assertFalse(ListSet.isSubsetOf(ListSet.singleton(3), ListSet.fromIterable(List#{1, 2}))) - @test - def isSubsetOf09(): Bool = ListSet.isSubsetOf(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{1, 2})) == true + @Test + def isSubsetOf09(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{1, 2}))) - @test - def isSubsetOf10(): Bool = ListSet.isSubsetOf(ListSet.fromIterable(List#{2, 1}), ListSet.fromIterable(List#{1, 2})) == true + @Test + def isSubsetOf10(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.fromIterable(List#{2, 1}), ListSet.fromIterable(List#{1, 2}))) - @test - def isSubsetOf11(): Bool = ListSet.isSubsetOf(ListSet.fromIterable(List#{3, 1}), ListSet.fromIterable(List#{1, 2})) == false + @Test + def isSubsetOf11(): Unit \ Assert = Assert.assertFalse(ListSet.isSubsetOf(ListSet.fromIterable(List#{3, 1}), ListSet.fromIterable(List#{1, 2}))) - @test - def isSubsetOf12(): Bool = ListSet.isSubsetOf(ListSet.fromIterable(List#{1, 2, 3}), ListSet.fromIterable(List#{1, 2})) == false + @Test + def isSubsetOf12(): Unit \ Assert = Assert.assertFalse(ListSet.isSubsetOf(ListSet.fromIterable(List#{1, 2, 3}), ListSet.fromIterable(List#{1, 2}))) - @test - def isSubsetOf13(): Bool = ListSet.isSubsetOf(ListSet.singleton(10), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == true + @Test + def isSubsetOf13(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.singleton(10), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def isSubsetOf14(): Bool = ListSet.isSubsetOf(ListSet.fromIterable(List#{9, 1}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == true + @Test + def isSubsetOf14(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.fromIterable(List#{9, 1}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def isSubsetOf15(): Bool = ListSet.isSubsetOf(ListSet.fromIterable(List#{6, 5, 8}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == true + @Test + def isSubsetOf15(): Unit \ Assert = Assert.assertTrue(ListSet.isSubsetOf(ListSet.fromIterable(List#{6, 5, 8}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def isSubsetOf16(): Bool = ListSet.isSubsetOf(ListSet.fromIterable(List#{10, 2, 3, 6, -1, 4}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == false + @Test + def isSubsetOf16(): Unit \ Assert = Assert.assertFalse(ListSet.isSubsetOf(ListSet.fromIterable(List#{10, 2, 3, 6, -1, 4}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) ///////////////////////////////////////////////////////////////////////////// // isProperSubsetOf // ///////////////////////////////////////////////////////////////////////////// - @test - def isProperSubsetOf01(): Bool = ListSet.isProperSubsetOf((ListSet.empty(): ListSet[Unit]), ListSet.empty()) == false + @Test + def isProperSubsetOf01(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf((ListSet.empty(): ListSet[Unit]), ListSet.empty())) - @test - def isProperSubsetOf02(): Bool = ListSet.isProperSubsetOf(ListSet.empty(), ListSet.singleton(1)) == true + @Test + def isProperSubsetOf02(): Unit \ Assert = Assert.assertTrue(ListSet.isProperSubsetOf(ListSet.empty(), ListSet.singleton(1))) - @test - def isProperSubsetOf03(): Bool = ListSet.isProperSubsetOf(ListSet.singleton(1), ListSet.singleton(1)) == false + @Test + def isProperSubsetOf03(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf(ListSet.singleton(1), ListSet.singleton(1))) - @test - def isProperSubsetOf04(): Bool = ListSet.isProperSubsetOf(ListSet.singleton(1), ListSet.singleton(2)) == false + @Test + def isProperSubsetOf04(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf(ListSet.singleton(1), ListSet.singleton(2))) - @test - def isProperSubsetOf05(): Bool = ListSet.isProperSubsetOf(ListSet.empty(), ListSet.fromIterable(List#{1, 2})) == true + @Test + def isProperSubsetOf05(): Unit \ Assert = Assert.assertTrue(ListSet.isProperSubsetOf(ListSet.empty(), ListSet.fromIterable(List#{1, 2}))) - @test - def isProperSubsetOf06(): Bool = ListSet.isProperSubsetOf(ListSet.singleton(1), ListSet.fromIterable(List#{1, 2})) == true + @Test + def isProperSubsetOf06(): Unit \ Assert = Assert.assertTrue(ListSet.isProperSubsetOf(ListSet.singleton(1), ListSet.fromIterable(List#{1, 2}))) - @test - def isProperSubsetOf07(): Bool = ListSet.isProperSubsetOf(ListSet.singleton(2), ListSet.fromIterable(List#{1, 2})) == true + @Test + def isProperSubsetOf07(): Unit \ Assert = Assert.assertTrue(ListSet.isProperSubsetOf(ListSet.singleton(2), ListSet.fromIterable(List#{1, 2}))) - @test - def isProperSubsetOf08(): Bool = ListSet.isProperSubsetOf(ListSet.singleton(3), ListSet.fromIterable(List#{1, 2})) == false + @Test + def isProperSubsetOf08(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf(ListSet.singleton(3), ListSet.fromIterable(List#{1, 2}))) - @test - def isProperSubsetOf09(): Bool = ListSet.isProperSubsetOf(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{1, 2})) == false + @Test + def isProperSubsetOf09(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{1, 2}))) - @test - def isProperSubsetOf10(): Bool = ListSet.isProperSubsetOf(ListSet.fromIterable(List#{2, 1}), ListSet.fromIterable(List#{1, 2})) == false + @Test + def isProperSubsetOf10(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf(ListSet.fromIterable(List#{2, 1}), ListSet.fromIterable(List#{1, 2}))) - @test - def isProperSubsetOf11(): Bool = ListSet.isProperSubsetOf(ListSet.fromIterable(List#{3, 1}), ListSet.fromIterable(List#{1, 2})) == false + @Test + def isProperSubsetOf11(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf(ListSet.fromIterable(List#{3, 1}), ListSet.fromIterable(List#{1, 2}))) - @test - def isProperSubsetOf12(): Bool = ListSet.isProperSubsetOf(ListSet.fromIterable(List#{1, 2, 3}), ListSet.fromIterable(List#{1, 2})) == false + @Test + def isProperSubsetOf12(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf(ListSet.fromIterable(List#{1, 2, 3}), ListSet.fromIterable(List#{1, 2}))) - @test - def isProperSubsetOf13(): Bool = ListSet.isProperSubsetOf(ListSet.singleton(10), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == true + @Test + def isProperSubsetOf13(): Unit \ Assert = Assert.assertTrue(ListSet.isProperSubsetOf(ListSet.singleton(10), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def isProperSubsetOf14(): Bool = ListSet.isProperSubsetOf(ListSet.fromIterable(List#{9, 1}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == true + @Test + def isProperSubsetOf14(): Unit \ Assert = Assert.assertTrue(ListSet.isProperSubsetOf(ListSet.fromIterable(List#{9, 1}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def isProperSubsetOf15(): Bool = ListSet.isProperSubsetOf(ListSet.fromIterable(List#{6, 5, 8}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == true + @Test + def isProperSubsetOf15(): Unit \ Assert = Assert.assertTrue(ListSet.isProperSubsetOf(ListSet.fromIterable(List#{6, 5, 8}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def isProperSubsetOf16(): Bool = ListSet.isProperSubsetOf(ListSet.fromIterable(List#{10, 2, 3, 6, -1, 4}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == false + @Test + def isProperSubsetOf16(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf(ListSet.fromIterable(List#{10, 2, 3, 6, -1, 4}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) - @test - def isProperSubsetOf17(): Bool = ListSet.isProperSubsetOf(ListSet.fromIterable(List#{10, 2, 3, 6, 1, 4, 5, 9, 8, 7}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) == false + @Test + def isProperSubsetOf17(): Unit \ Assert = Assert.assertFalse(ListSet.isProperSubsetOf(ListSet.fromIterable(List#{10, 2, 3, 6, 1, 4, 5, 9, 8, 7}), ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))) ///////////////////////////////////////////////////////////////////////////// // count // ///////////////////////////////////////////////////////////////////////////// - @test - def count01(): Bool = ListSet.count(i -> i > 3, ListSet.empty()) == 0 + @Test + def count01(): Unit \ Assert = Assert.assertEq(expected = 0, ListSet.count(i -> i > 3, ListSet.empty())) - @test - def count02(): Bool = ListSet.count(i -> i > 3, ListSet.singleton(1)) == 0 + @Test + def count02(): Unit \ Assert = Assert.assertEq(expected = 0, ListSet.count(i -> i > 3, ListSet.singleton(1))) - @test - def count03(): Bool = ListSet.count(i -> i > 3, ListSet.singleton(4)) == 1 + @Test + def count03(): Unit \ Assert = Assert.assertEq(expected = 1, ListSet.count(i -> i > 3, ListSet.singleton(4))) - @test - def count04(): Bool = ListSet.count(i -> i > 3, ListSet.fromIterable(List#{2, 1})) == 0 + @Test + def count04(): Unit \ Assert = Assert.assertEq(expected = 0, ListSet.count(i -> i > 3, ListSet.fromIterable(List#{2, 1}))) - @test - def count05(): Bool = ListSet.count(i -> i > 3, ListSet.fromIterable(List#{8, 1})) == 1 + @Test + def count05(): Unit \ Assert = Assert.assertEq(expected = 1, ListSet.count(i -> i > 3, ListSet.fromIterable(List#{8, 1}))) - @test - def count06(): Bool = ListSet.count(i -> i > 3, ListSet.fromIterable(List#{1, 8})) == 1 + @Test + def count06(): Unit \ Assert = Assert.assertEq(expected = 1, ListSet.count(i -> i > 3, ListSet.fromIterable(List#{1, 8}))) - @test - def count07(): Bool = ListSet.count(i -> i > 3, ListSet.fromIterable(List#{7, 6})) == 2 + @Test + def count07(): Unit \ Assert = Assert.assertEq(expected = 2, ListSet.count(i -> i > 3, ListSet.fromIterable(List#{7, 6}))) ///////////////////////////////////////////////////////////////////////////// // sumWith // ///////////////////////////////////////////////////////////////////////////// - @test - def sumWith01(): Bool = - ListSet.empty() |> ListSet.sumWith(x -> x + 1) == 0 + @Test + def sumWith01(): Unit \ Assert = + Assert.assertEq(expected = 0, ListSet.empty() |> ListSet.sumWith(x -> x + 1)) - @test - def sumWith02(): Bool = - ListSet.singleton(1) |> ListSet.sumWith(x -> x + 1) == 2 + @Test + def sumWith02(): Unit \ Assert = + Assert.assertEq(expected = 2, ListSet.singleton(1) |> ListSet.sumWith(x -> x + 1)) - @test - def sumWith03(): Bool = - ListSet.fromIterable(List#{1, 2, 3}) |> ListSet.sumWith(x -> x + 1) == 9 + @Test + def sumWith03(): Unit \ Assert = + Assert.assertEq(expected = 9, ListSet.fromIterable(List#{1, 2, 3}) |> ListSet.sumWith(x -> x + 1)) - @test - def sumWith04(): Bool = - ListSet.fromIterable(List#{1, 2, 3, -3}) |> ListSet.sumWith(x -> x + 1) == 7 + @Test + def sumWith04(): Unit \ Assert = + Assert.assertEq(expected = 7, ListSet.fromIterable(List#{1, 2, 3, -3}) |> ListSet.sumWith(x -> x + 1)) - @test - def sumWith05(): Bool = - ListSet.fromIterable(List#{-1, -2, -3, -4}) |> ListSet.sumWith(x -> x + 1) == -6 + @Test + def sumWith05(): Unit \ Assert = + Assert.assertEq(expected = -6, ListSet.fromIterable(List#{-1, -2, -3, -4}) |> ListSet.sumWith(x -> x + 1)) - @test - def sumWith06(): Bool = - ListSet.fromIterable(List#{10, -10}) |> ListSet.sumWith(x -> x + 1) == 2 + @Test + def sumWith06(): Unit \ Assert = + Assert.assertEq(expected = 2, ListSet.fromIterable(List#{10, -10}) |> ListSet.sumWith(x -> x + 1)) ///////////////////////////////////////////////////////////////////////////// // flatten // ///////////////////////////////////////////////////////////////////////////// - @test - def flatten01(): Bool = (ListSet.flatten(ListSet.empty()): ListSet[Unit]) == ListSet.empty() + @Test + def flatten01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), (ListSet.flatten(ListSet.empty()): ListSet[Unit])) - @test - def flatten02(): Bool = ListSet.flatten((ListSet.fromIterable(List#{ListSet.empty()}): ListSet[ListSet[Unit]])) == ListSet.empty() + @Test + def flatten02(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.flatten((ListSet.fromIterable(List#{ListSet.empty()}): ListSet[ListSet[Unit]]))) - @test - def flatten03(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1)})) == ListSet.singleton(1) + @Test + def flatten03(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1)}))) - @test - def flatten04(): Bool = ListSet.flatten(ListSet.singleton(ListSet.fromIterable(List#{1, 2}))) == ListSet.fromIterable(List#{1, 2}) + @Test + def flatten04(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2}), ListSet.flatten(ListSet.singleton(ListSet.fromIterable(List#{1, 2})))) - @test - def flatten05(): Bool = (ListSet.flatten(ListSet.fromIterable(List#{ListSet.empty(), ListSet.empty()})): ListSet[Unit]) == ListSet.empty() + @Test + def flatten05(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), (ListSet.flatten(ListSet.fromIterable(List#{ListSet.empty(), ListSet.empty()})): ListSet[Unit])) - @test - def flatten06(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.empty()})) == ListSet.singleton(1) + @Test + def flatten06(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.empty()}))) - @test - def flatten07(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.empty(), ListSet.singleton(1)})) == ListSet.singleton(1) + @Test + def flatten07(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.flatten(ListSet.fromIterable(List#{ListSet.empty(), ListSet.singleton(1)}))) - @test - def flatten08(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.singleton(2)})) == ListSet.fromIterable(List#{1, 2}) + @Test + def flatten08(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2}), ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.singleton(2)}))) - @test - def flatten09(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.singleton(1)})) == ListSet.singleton(1) + @Test + def flatten09(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.singleton(1)}))) - @test - def flatten10(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 4, 5})})) == ListSet.fromIterable(List#{1, 2, 3, 4, 5}) + @Test + def flatten10(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3, 4, 5}), ListSet.flatten(ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 4, 5})}))) - @test - def flatten11(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 4, 3})})) == ListSet.fromIterable(List#{1, 2, 3, 4}) + @Test + def flatten11(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3, 4}), ListSet.flatten(ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 4, 3})}))) - @test - def flatten12(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 4, 1})})) == ListSet.fromIterable(List#{1, 2, 3, 4}) + @Test + def flatten12(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3, 4}), ListSet.flatten(ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 4, 1})}))) - @test - def flatten13(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.fromIterable(List#{2, 3}), ListSet.singleton(4)})) == ListSet.fromIterable(List#{1, 2, 3, 4}) + @Test + def flatten13(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3, 4}), ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.fromIterable(List#{2, 3}), ListSet.singleton(4)}))) - @test - def flatten14(): Bool = ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.fromIterable(List#{2, 3}), ListSet.singleton(1)})) == ListSet.fromIterable(List#{1, 2, 3}) + @Test + def flatten14(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3}), ListSet.flatten(ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.fromIterable(List#{2, 3}), ListSet.singleton(1)}))) ///////////////////////////////////////////////////////////////////////////// // exists // ///////////////////////////////////////////////////////////////////////////// - @test - def exists01(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.empty()) == false + @Test + def exists01(): Unit \ Assert = Assert.assertFalse(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.empty())) - @test - def exists02(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(5)) == false + @Test + def exists02(): Unit \ Assert = Assert.assertFalse(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(5))) - @test - def exists03(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(7)) == true + @Test + def exists03(): Unit \ Assert = Assert.assertTrue(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(7))) - @test - def exists04(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(15)) == true + @Test + def exists04(): Unit \ Assert = Assert.assertTrue(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(15))) - @test - def exists05(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{1, 44})) == false + @Test + def exists05(): Unit \ Assert = Assert.assertFalse(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{1, 44}))) - @test - def exists06(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, 71})) == true + @Test + def exists06(): Unit \ Assert = Assert.assertTrue(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, 71}))) - @test - def exists07(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{71, 12})) == true + @Test + def exists07(): Unit \ Assert = Assert.assertTrue(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{71, 12}))) - @test - def exists08(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{71, 79})) == true + @Test + def exists08(): Unit \ Assert = Assert.assertTrue(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{71, 79}))) - @test - def exists09(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, -1, -14, -2, 84, 113})) == false + @Test + def exists09(): Unit \ Assert = Assert.assertFalse(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, -1, -14, -2, 84, 113}))) - @test - def exists10(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, -1, 31, -14, -2, 84, 111})) == true + @Test + def exists10(): Unit \ Assert = Assert.assertTrue(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, -1, 31, -14, -2, 84, 111}))) - @test - def exists11(): Bool = ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, -1, -14, -2, 84, 111, 38})) == true + @Test + def exists11(): Unit \ Assert = Assert.assertTrue(ListSet.exists(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, -1, -14, -2, 84, 111, 38}))) ///////////////////////////////////////////////////////////////////////////// // forAll // ///////////////////////////////////////////////////////////////////////////// - @test - def forAll01(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.empty()) == true + @Test + def forAll01(): Unit \ Assert = Assert.assertTrue(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.empty())) - @test - def forAll02(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(5)) == false + @Test + def forAll02(): Unit \ Assert = Assert.assertFalse(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(5))) - @test - def forAll03(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(7)) == true + @Test + def forAll03(): Unit \ Assert = Assert.assertTrue(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(7))) - @test - def forAll04(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(15)) == true + @Test + def forAll04(): Unit \ Assert = Assert.assertTrue(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.singleton(15))) - @test - def forAll05(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{1, 44})) == false + @Test + def forAll05(): Unit \ Assert = Assert.assertFalse(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{1, 44}))) - @test - def forAll06(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, 71})) == false + @Test + def forAll06(): Unit \ Assert = Assert.assertFalse(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{11, 71}))) - @test - def forAll07(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{71, 12})) == false + @Test + def forAll07(): Unit \ Assert = Assert.assertFalse(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{71, 12}))) - @test - def forAll08(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{71, 79})) == true + @Test + def forAll08(): Unit \ Assert = Assert.assertTrue(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{71, 79}))) - @test - def forAll09(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{7, 15, 23, 84, 111})) == false + @Test + def forAll09(): Unit \ Assert = Assert.assertFalse(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{7, 15, 23, 84, 111}))) - @test - def forAll10(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{7, 15, 23, 111, 3})) == false + @Test + def forAll10(): Unit \ Assert = Assert.assertFalse(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{7, 15, 23, 111, 3}))) - @test - def forAll11(): Bool = ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{7, 15, 23, 119, 111})) == true + @Test + def forAll11(): Unit \ Assert = Assert.assertTrue(ListSet.forAll(x -> x `Int32.remainder` 8 == 7, ListSet.fromIterable(List#{7, 15, 23, 119, 111}))) ///////////////////////////////////////////////////////////////////////////// // union // ///////////////////////////////////////////////////////////////////////////// - @test - def union01(): Bool = ListSet.union((ListSet.empty(): ListSet[Unit]), ListSet.empty()) == ListSet.empty() + @Test + def union01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.union((ListSet.empty(): ListSet[Unit]), ListSet.empty())) - @test - def union02(): Bool = ListSet.union(ListSet.singleton(1), ListSet.empty()) == ListSet.singleton(1) + @Test + def union02(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.union(ListSet.singleton(1), ListSet.empty())) - @test - def union03(): Bool = ListSet.union(ListSet.empty(), ListSet.singleton(2)) == ListSet.singleton(2) + @Test + def union03(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(2), ListSet.union(ListSet.empty(), ListSet.singleton(2))) - @test - def union04(): Bool = ListSet.union(ListSet.singleton(1), ListSet.singleton(1)) == ListSet.singleton(1) + @Test + def union04(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.union(ListSet.singleton(1), ListSet.singleton(1))) - @test - def union05(): Bool = ListSet.union(ListSet.singleton(1), ListSet.fromIterable(List#{-1})) == ListSet.fromIterable(List#{1, -1}) + @Test + def union05(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, -1}), ListSet.union(ListSet.singleton(1), ListSet.fromIterable(List#{-1}))) - @test - def union06(): Bool = ListSet.union(ListSet.empty(), ListSet.fromIterable(List#{-1, 9})) == ListSet.fromIterable(List#{-1, 9}) + @Test + def union06(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{-1, 9}), ListSet.union(ListSet.empty(), ListSet.fromIterable(List#{-1, 9}))) - @test - def union07(): Bool = ListSet.union(ListSet.singleton(9), ListSet.fromIterable(List#{-1, 9})) == ListSet.fromIterable(List#{-1, 9}) + @Test + def union07(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{-1, 9}), ListSet.union(ListSet.singleton(9), ListSet.fromIterable(List#{-1, 9}))) - @test - def union08(): Bool = ListSet.union(ListSet.singleton(4), ListSet.fromIterable(List#{-1, 9})) == ListSet.fromIterable(List#{4, -1, 9}) + @Test + def union08(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{4, -1, 9}), ListSet.union(ListSet.singleton(4), ListSet.fromIterable(List#{-1, 9}))) - @test - def union09(): Bool = ListSet.union(ListSet.fromIterable(List#{9, -1}), ListSet.fromIterable(List#{-1, 9})) == ListSet.fromIterable(List#{-1, 9}) + @Test + def union09(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{-1, 9}), ListSet.union(ListSet.fromIterable(List#{9, -1}), ListSet.fromIterable(List#{-1, 9}))) - @test - def union10(): Bool = ListSet.union(ListSet.fromIterable(List#{9, 5}), ListSet.fromIterable(List#{-1, 9})) == ListSet.fromIterable(List#{5, -1, 9}) + @Test + def union10(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{5, -1, 9}), ListSet.union(ListSet.fromIterable(List#{9, 5}), ListSet.fromIterable(List#{-1, 9}))) - @test - def union11(): Bool = ListSet.union(ListSet.fromIterable(List#{6, 5}), ListSet.fromIterable(List#{-1, 9})) == ListSet.fromIterable(List#{6, 5, -1, 9}) + @Test + def union11(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{6, 5, -1, 9}), ListSet.union(ListSet.fromIterable(List#{6, 5}), ListSet.fromIterable(List#{-1, 9}))) - @test - def union12(): Bool = ListSet.union(ListSet.fromIterable(List#{6, -99}), ListSet.fromIterable(List#{6, 5, -1, 9, 43, 7, 8, -99})) == ListSet.fromIterable(List#{6, 5, -1, 9, 43, 7, 8, -99}) + @Test + def union12(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{6, 5, -1, 9, 43, 7, 8, -99}), ListSet.union(ListSet.fromIterable(List#{6, -99}), ListSet.fromIterable(List#{6, 5, -1, 9, 43, 7, 8, -99}))) - @test - def union13(): Bool = ListSet.union(ListSet.fromIterable(List#{6, -99, -1, 5, 22}), ListSet.fromIterable(List#{6, 5, -1, 9, 43, 7, 8, -99})) == ListSet.fromIterable(List#{22, 6, 5, -1, 9, 43, 7, 8, -99}) + @Test + def union13(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{22, 6, 5, -1, 9, 43, 7, 8, -99}), ListSet.union(ListSet.fromIterable(List#{6, -99, -1, 5, 22}), ListSet.fromIterable(List#{6, 5, -1, 9, 43, 7, 8, -99}))) - @test - def union14(): Bool = ListSet.union(ListSet.fromIterable(List#{-2, -3, -4}), ListSet.fromIterable(List#{6, 5, -1, 9, 43, 7, 8, -99})) == ListSet.fromIterable(List#{-2, -3, -4, 6, 5, -1, 9, 43, 7, 8, -99}) + @Test + def union14(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{-2, -3, -4, 6, 5, -1, 9, 43, 7, 8, -99}), ListSet.union(ListSet.fromIterable(List#{-2, -3, -4}), ListSet.fromIterable(List#{6, 5, -1, 9, 43, 7, 8, -99}))) ///////////////////////////////////////////////////////////////////////////// // intersection // ///////////////////////////////////////////////////////////////////////////// - @test - def intersection01(): Bool = ListSet.intersection((ListSet.empty(): ListSet[Unit]), ListSet.empty()) == ListSet.empty() + @Test + def intersection01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.intersection((ListSet.empty(): ListSet[Unit]), ListSet.empty())) - @test - def intersection02(): Bool = ListSet.intersection(ListSet.singleton(1), ListSet.empty()) == ListSet.empty() + @Test + def intersection02(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.intersection(ListSet.singleton(1), ListSet.empty())) - @test - def intersection03(): Bool = ListSet.intersection(ListSet.empty(), ListSet.singleton(2)) == ListSet.empty() + @Test + def intersection03(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.intersection(ListSet.empty(), ListSet.singleton(2))) - @test - def intersection04(): Bool = ListSet.intersection(ListSet.singleton(1), ListSet.singleton(2)) == ListSet.empty() + @Test + def intersection04(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.intersection(ListSet.singleton(1), ListSet.singleton(2))) - @test - def intersection05(): Bool = ListSet.intersection(ListSet.singleton(1), ListSet.singleton(1)) == ListSet.singleton(1) + @Test + def intersection05(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.intersection(ListSet.singleton(1), ListSet.singleton(1))) - @test - def intersection06(): Bool = ListSet.intersection(ListSet.empty(), ListSet.fromIterable(List#{1, 2})) == ListSet.empty() + @Test + def intersection06(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.intersection(ListSet.empty(), ListSet.fromIterable(List#{1, 2}))) - @test - def intersection07(): Bool = ListSet.intersection(ListSet.fromIterable(List#{1, 2}), ListSet.empty()) == ListSet.empty() + @Test + def intersection07(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.intersection(ListSet.fromIterable(List#{1, 2}), ListSet.empty())) - @test - def intersection08(): Bool = ListSet.intersection(ListSet.singleton(2), ListSet.fromIterable(List#{1, 2})) == ListSet.singleton(2) + @Test + def intersection08(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(2), ListSet.intersection(ListSet.singleton(2), ListSet.fromIterable(List#{1, 2}))) - @test - def intersection09(): Bool = ListSet.intersection(ListSet.singleton(1), ListSet.fromIterable(List#{1, 2})) == ListSet.singleton(1) + @Test + def intersection09(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.intersection(ListSet.singleton(1), ListSet.fromIterable(List#{1, 2}))) - @test - def intersection10(): Bool = ListSet.intersection(ListSet.fromIterable(List#{2, 1}), ListSet.fromIterable(List#{1, 2})) == ListSet.fromIterable(List#{2, 1}) + @Test + def intersection10(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{2, 1}), ListSet.intersection(ListSet.fromIterable(List#{2, 1}), ListSet.fromIterable(List#{1, 2}))) - @test - def intersection11(): Bool = ListSet.intersection(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{1, 2})) == ListSet.fromIterable(List#{1, 2}) + @Test + def intersection11(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2}), ListSet.intersection(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{1, 2}))) - @test - def intersection12(): Bool = ListSet.intersection(ListSet.fromIterable(List#{3, 2}), ListSet.fromIterable(List#{1, 2})) == ListSet.singleton(2) + @Test + def intersection12(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(2), ListSet.intersection(ListSet.fromIterable(List#{3, 2}), ListSet.fromIterable(List#{1, 2}))) - @test - def intersection13(): Bool = ListSet.intersection(ListSet.fromIterable(List#{3, 55}), ListSet.fromIterable(List#{1, 2})) == ListSet.empty() + @Test + def intersection13(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.intersection(ListSet.fromIterable(List#{3, 55}), ListSet.fromIterable(List#{1, 2}))) - @test - def intersection14(): Bool = ListSet.intersection(ListSet.fromIterable(List#{3, 55, 11, 87, 22, 34, -87, 23}), ListSet.fromIterable(List#{1, 2, 84, -87, 87, 3, 44})) == ListSet.fromIterable(List#{3, 87, -87}) + @Test + def intersection14(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{3, 87, -87}), ListSet.intersection(ListSet.fromIterable(List#{3, 55, 11, 87, 22, 34, -87, 23}), ListSet.fromIterable(List#{1, 2, 84, -87, 87, 3, 44}))) - @test - def intersection15(): Bool = ListSet.intersection(ListSet.fromIterable(List#{3, 55, 11, 87, 22, 34, -87, 23}), ListSet.fromIterable(List#{23, 1, 2, 84, 87, 3})) == ListSet.fromIterable(List#{3, 87, 23}) + @Test + def intersection15(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{3, 87, 23}), ListSet.intersection(ListSet.fromIterable(List#{3, 55, 11, 87, 22, 34, -87, 23}), ListSet.fromIterable(List#{23, 1, 2, 84, 87, 3}))) ///////////////////////////////////////////////////////////////////////////// // difference // ///////////////////////////////////////////////////////////////////////////// - @test - def difference01(): Bool = ListSet.difference((ListSet.empty(): ListSet[Unit]), ListSet.empty()) == ListSet.empty() + @Test + def difference01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.difference((ListSet.empty(): ListSet[Unit]), ListSet.empty())) - @test - def difference02(): Bool = ListSet.difference(ListSet.empty(), ListSet.singleton(2)) == ListSet.empty() + @Test + def difference02(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.difference(ListSet.empty(), ListSet.singleton(2))) - @test - def difference03(): Bool = ListSet.difference(ListSet.singleton(1), ListSet.empty()) == ListSet.singleton(1) + @Test + def difference03(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.difference(ListSet.singleton(1), ListSet.empty())) - @test - def difference04(): Bool = ListSet.difference(ListSet.singleton(1), ListSet.singleton(2)) == ListSet.singleton(1) + @Test + def difference04(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.difference(ListSet.singleton(1), ListSet.singleton(2))) - @test - def difference05(): Bool = ListSet.difference(ListSet.singleton(1), ListSet.singleton(1)) == ListSet.empty() + @Test + def difference05(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.difference(ListSet.singleton(1), ListSet.singleton(1))) - @test - def difference06(): Bool = ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.empty()) == ListSet.fromIterable(List#{1, 2}) + @Test + def difference06(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2}), ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.empty())) - @test - def difference07(): Bool = ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.singleton(1)) == ListSet.singleton(2) + @Test + def difference07(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(2), ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.singleton(1))) - @test - def difference08(): Bool = ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.singleton(2)) == ListSet.singleton(1) + @Test + def difference08(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.singleton(2))) - @test - def difference09(): Bool = ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{8, 2, 4})) == ListSet.singleton(1) + @Test + def difference09(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{8, 2, 4}))) - @test - def difference10(): Bool = ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 1, 2, 4})) == ListSet.empty() + @Test + def difference10(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 1, 2, 4}))) - @test - def difference11(): Bool = ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 11, 21, 4})) == ListSet.fromIterable(List#{1, 2}) + @Test + def difference11(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2}), ListSet.difference(ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{3, 11, 21, 4}))) - @test - def difference12(): Bool = ListSet.difference(ListSet.fromIterable(List#{1, 2, 87, 4, 5, 6, 86, 92, 111, -1}), ListSet.fromIterable(List#{-1, 92, 4, 5, 1, 2, 86})) == ListSet.fromIterable(List#{87, 6, 111}) + @Test + def difference12(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{87, 6, 111}), ListSet.difference(ListSet.fromIterable(List#{1, 2, 87, 4, 5, 6, 86, 92, 111, -1}), ListSet.fromIterable(List#{-1, 92, 4, 5, 1, 2, 86}))) - @test - def difference13(): Bool = ListSet.difference(ListSet.fromIterable(List#{1, 2, 87, 4, 5, 6, 86, 92, 111, -1}), ListSet.fromIterable(List#{-1, 92, 4, 5, 1, 2, 86, 99, 6})) == ListSet.fromIterable(List#{87, 111}) + @Test + def difference13(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{87, 111}), ListSet.difference(ListSet.fromIterable(List#{1, 2, 87, 4, 5, 6, 86, 92, 111, -1}), ListSet.fromIterable(List#{-1, 92, 4, 5, 1, 2, 86, 99, 6}))) ///////////////////////////////////////////////////////////////////////////// // subsets // ///////////////////////////////////////////////////////////////////////////// - @test - def subsets01(): Bool = ListSet.subsets((ListSet.empty(): ListSet[Unit])) == ListSet.fromIterable(List#{ListSet.empty()}) + @Test + def subsets01(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{ListSet.empty()}), ListSet.subsets((ListSet.empty(): ListSet[Unit]))) - @test - def subsets02(): Bool = ListSet.subsets(ListSet.singleton(1)) == ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.empty()}) + @Test + def subsets02(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{ListSet.singleton(1), ListSet.empty()}), ListSet.subsets(ListSet.singleton(1))) - @test - def subsets03(): Bool = ListSet.subsets(ListSet.fromIterable(List#{1, 2})) == ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.singleton(1), ListSet.singleton(2), ListSet.empty()}) + @Test + def subsets03(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.singleton(1), ListSet.singleton(2), ListSet.empty()}), ListSet.subsets(ListSet.fromIterable(List#{1, 2}))) - @test - def subsets04(): Bool = ListSet.subsets(ListSet.fromIterable(List#{1, 2, 3})) == ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2, 3}), ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{1, 3}), ListSet.singleton(1), ListSet.fromIterable(List#{2, 3}), ListSet.singleton(2), ListSet.singleton(3), ListSet.empty()}) + @Test + def subsets04(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2, 3}), ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{1, 3}), ListSet.singleton(1), ListSet.fromIterable(List#{2, 3}), ListSet.singleton(2), ListSet.singleton(3), ListSet.empty()}), ListSet.subsets(ListSet.fromIterable(List#{1, 2, 3}))) ///////////////////////////////////////////////////////////////////////////// // filter // ///////////////////////////////////////////////////////////////////////////// - @test - def filter01(): Bool = ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.empty()) == ListSet.empty() + @Test + def filter01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.empty())) - @test - def filter02(): Bool = ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(1)) == ListSet.empty() + @Test + def filter02(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(1))) - @test - def filter03(): Bool = ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(2)) == ListSet.singleton(2) + @Test + def filter03(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(2), ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(2))) - @test - def filter04(): Bool = ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, 3})) == ListSet.empty() + @Test + def filter04(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, 3}))) - @test - def filter05(): Bool = ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{8, 3})) == ListSet.singleton(8) + @Test + def filter05(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(8), ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{8, 3}))) - @test - def filter06(): Bool = ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{-1, 32})) == ListSet.singleton(32) + @Test + def filter06(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(32), ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{-1, 32}))) - @test - def filter07(): Bool = ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, 34})) == ListSet.fromIterable(List#{12, 34}) + @Test + def filter07(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{12, 34}), ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, 34}))) - @test - def filter08(): Bool = ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{-33, -1, 12, 1, 34, 88, 7, 77, 31})) == ListSet.fromIterable(List#{12, 34, 88}) + @Test + def filter08(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{12, 34, 88}), ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{-33, -1, 12, 1, 34, 88, 7, 77, 31}))) - @test - def filter09(): Bool = ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{-33, -1, 12, 1, 34, 88, 7, 77, 31, 7, -92, 841})) == ListSet.fromIterable(List#{12, 34, 88, -92}) + @Test + def filter09(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{12, 34, 88, -92}), ListSet.filter(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{-33, -1, 12, 1, 34, 88, 7, 77, 31, 7, -92, 841}))) ///////////////////////////////////////////////////////////////////////////// // map // ///////////////////////////////////////////////////////////////////////////// - @test - def map01(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.empty()) == ListSet.empty() + @Test + def map01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.empty())) - @test - def map02(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(1)) == ListSet.fromIterable(List#{false}) + @Test + def map02(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{false}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(1))) - @test - def map03(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(2)) == ListSet.fromIterable(List#{true}) + @Test + def map03(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{true}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(2))) - @test - def map04(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, -1})) == ListSet.fromIterable(List#{false}) + @Test + def map04(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{false}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, -1}))) - @test - def map05(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, -12})) == ListSet.fromIterable(List#{false, true}) + @Test + def map05(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{false, true}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, -12}))) - @test - def map06(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{16, -1})) == ListSet.fromIterable(List#{true, false}) + @Test + def map06(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{true, false}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{16, -1}))) - @test - def map07(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12})) == ListSet.fromIterable(List#{true}) + @Test + def map07(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{true}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12}))) - @test - def map08(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12})) == ListSet.fromIterable(List#{true}) + @Test + def map08(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{true}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12}))) - @test - def map09(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12, 1, 14})) == ListSet.fromIterable(List#{false, true}) + @Test + def map09(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{false, true}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12, 1, 14}))) - @test - def map10(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12, 1, 14, 7, 88, -91})) == ListSet.fromIterable(List#{true, false}) + @Test + def map10(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{true, false}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12, 1, 14, 7, 88, -91}))) - @test - def map11(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12, 122, 14})) == ListSet.fromIterable(List#{true}) + @Test + def map11(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{true}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{12, -12, 122, 14}))) - @test - def map12(): Bool = ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{123, -123, 1223, 141})) == ListSet.fromIterable(List#{false}) + @Test + def map12(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{false}), ListSet.map(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{123, -123, 1223, 141}))) - @test - def map13(): Bool = ListSet.map(x -> x `Int32.remainder` 9, ListSet.fromIterable(List#{11, 5, 16, 4})) == ListSet.fromIterable(List#{2, 5, 7, 4}) + @Test + def map13(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{2, 5, 7, 4}), ListSet.map(x -> x `Int32.remainder` 9, ListSet.fromIterable(List#{11, 5, 16, 4}))) - @test - def map14(): Bool = ListSet.map(x -> x `Int32.remainder` 9, ListSet.fromIterable(List#{0, 5, 1, -9, -8})) == ListSet.fromIterable(List#{5, 1, 0, -8}) + @Test + def map14(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{5, 1, 0, -8}), ListSet.map(x -> x `Int32.remainder` 9, ListSet.fromIterable(List#{0, 5, 1, -9, -8}))) - @test - def map15(): Bool = ListSet.map(x -> x `Int32.remainder` 9, ListSet.fromIterable(List#{0, 5, 1, 10, 7, 19, 28, 2})) == ListSet.fromIterable(List#{0, 5, 7, 1, 2}) + @Test + def map15(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{0, 5, 7, 1, 2}), ListSet.map(x -> x `Int32.remainder` 9, ListSet.fromIterable(List#{0, 5, 1, 10, 7, 19, 28, 2}))) ///////////////////////////////////////////////////////////////////////////// // filterMap // ///////////////////////////////////////////////////////////////////////////// - @test - def filterMap01(): Bool = - ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.empty()) == ListSet.empty() + @Test + def filterMap01(): Unit \ Assert = + Assert.assertEq(expected = ListSet.empty(), ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.empty())) - @test - def filterMap02(): Bool = - ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.singleton(1)) == ListSet.empty() + @Test + def filterMap02(): Unit \ Assert = + Assert.assertEq(expected = ListSet.empty(), ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.singleton(1))) - @test - def filterMap03(): Bool = - ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.singleton(2)) == ListSet.singleton(1) + @Test + def filterMap03(): Unit \ Assert = + Assert.assertEq(expected = ListSet.singleton(1), ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.singleton(2))) - @test - def filterMap04(): Bool = - ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.fromIterable(List#{1, 3})) == ListSet.empty() + @Test + def filterMap04(): Unit \ Assert = + Assert.assertEq(expected = ListSet.empty(), ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.fromIterable(List#{1, 3}))) - @test - def filterMap05(): Bool = - ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.fromIterable(List#{1, 4})) == ListSet.singleton(2) + @Test + def filterMap05(): Unit \ Assert = + Assert.assertEq(expected = ListSet.singleton(2), ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.fromIterable(List#{1, 4}))) - @test - def filterMap06(): Bool = - ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.fromIterable(List#{-1, 6})) == ListSet.singleton(3) + @Test + def filterMap06(): Unit \ Assert = + Assert.assertEq(expected = ListSet.singleton(3), ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.fromIterable(List#{-1, 6}))) - @test - def filterMap07(): Bool = - ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.fromIterable(List#{6, 8})) == ListSet.fromIterable(List#{3, 4}) + @Test + def filterMap07(): Unit \ Assert = + Assert.assertEq(expected = ListSet.fromIterable(List#{3, 4}), ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, ListSet.fromIterable(List#{6, 8}))) - @test - def filterMap08(): Bool = + @Test + def filterMap08(): Unit \ Assert = let s1 = ListSet.fromIterable(List#{0, 1, 2, 3, 4, 5, 10}); let s2 = ListSet.fromIterable(List#{0, 1, 2, 5}); - ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, s1) == s2 + Assert.assertEq(expected = s2, ListSet.filterMap(i -> if (i `Int32.remainder` 2 == 0) Some(i/2) else None, s1)) ///////////////////////////////////////////////////////////////////////////// // replace // ///////////////////////////////////////////////////////////////////////////// - @test - def replace01(): Bool = ListSet.replace(src = 3, dst = 4, ListSet.empty()) == ListSet.empty() + @Test + def replace01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), ListSet.replace(src = 3, dst = 4, ListSet.empty())) - @test - def replace02(): Bool = ListSet.replace(src = 3, dst = 4, ListSet.singleton(1)) == ListSet.singleton(1) + @Test + def replace02(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.replace(src = 3, dst = 4, ListSet.singleton(1))) - @test - def replace03(): Bool = ListSet.replace(src = 3, dst = 4, ListSet.singleton(3)) == ListSet.singleton(4) + @Test + def replace03(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(4), ListSet.replace(src = 3, dst = 4, ListSet.singleton(3))) - @test - def replace04(): Bool = ListSet.replace(src = 3, dst = 4, ListSet.singleton(4)) == ListSet.singleton(4) + @Test + def replace04(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(4), ListSet.replace(src = 3, dst = 4, ListSet.singleton(4))) - @test - def replace05(): Bool = ListSet.replace(src = 3, dst = 4, ListSet.fromIterable(List#{1, 2})) == ListSet.fromIterable(List#{1, 2}) + @Test + def replace05(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2}), ListSet.replace(src = 3, dst = 4, ListSet.fromIterable(List#{1, 2}))) - @test - def replace06(): Bool = ListSet.replace(src = 3, dst = 4, ListSet.fromIterable(List#{1, 3})) == ListSet.fromIterable(List#{1, 4}) + @Test + def replace06(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 4}), ListSet.replace(src = 3, dst = 4, ListSet.fromIterable(List#{1, 3}))) - @test - def replace07(): Bool = ListSet.replace(src = 3, dst = 4, ListSet.fromIterable(List#{3, 2})) == ListSet.fromIterable(List#{4, 2}) + @Test + def replace07(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{4, 2}), ListSet.replace(src = 3, dst = 4, ListSet.fromIterable(List#{3, 2}))) - @test - def replace08(): Bool = ListSet.replace(src = 3, dst = 4, ListSet.fromIterable(List#{3, 4})) == ListSet.singleton(4) + @Test + def replace08(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(4), ListSet.replace(src = 3, dst = 4, ListSet.fromIterable(List#{3, 4}))) ///////////////////////////////////////////////////////////////////////////// // partition // ///////////////////////////////////////////////////////////////////////////// - @test - def partition01(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.empty()) == (ListSet.empty(), ListSet.empty()) + @Test + def partition01(): Unit \ Assert = Assert.assertEq(expected = (ListSet.empty(), ListSet.empty()), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.empty())) - @test - def partition02(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(1)) == (ListSet.empty(), ListSet.singleton(1)) + @Test + def partition02(): Unit \ Assert = Assert.assertEq(expected = (ListSet.empty(), ListSet.singleton(1)), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(1))) - @test - def partition03(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(2)) == (ListSet.singleton(2), ListSet.empty()) + @Test + def partition03(): Unit \ Assert = Assert.assertEq(expected = (ListSet.singleton(2), ListSet.empty()), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.singleton(2))) - @test - def partition04(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, 3})) == (ListSet.empty(), ListSet.fromIterable(List#{1, 3})) + @Test + def partition04(): Unit \ Assert = Assert.assertEq(expected = (ListSet.empty(), ListSet.fromIterable(List#{1, 3})), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, 3}))) - @test - def partition05(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, 2})) == (ListSet.singleton(2), ListSet.singleton(1)) + @Test + def partition05(): Unit \ Assert = Assert.assertEq(expected = (ListSet.singleton(2), ListSet.singleton(1)), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, 2}))) - @test - def partition06(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{2, 1})) == (ListSet.singleton(2), ListSet.singleton(1)) + @Test + def partition06(): Unit \ Assert = Assert.assertEq(expected = (ListSet.singleton(2), ListSet.singleton(1)), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{2, 1}))) - @test - def partition07(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{2, -4})) == (ListSet.fromIterable(List#{2, -4}), ListSet.empty()) + @Test + def partition07(): Unit \ Assert = Assert.assertEq(expected = (ListSet.fromIterable(List#{2, -4}), ListSet.empty()), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{2, -4}))) - @test - def partition08(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{2, -11, 89, -4, 11, -6, 84})) == (ListSet.fromIterable(List#{2, -4, -6, 84}), ListSet.fromIterable(List#{-11, 89, 11})) + @Test + def partition08(): Unit \ Assert = Assert.assertEq(expected = (ListSet.fromIterable(List#{2, -4, -6, 84}), ListSet.fromIterable(List#{-11, 89, 11})), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{2, -11, 89, -4, 11, -6, 84}))) - @test - def partition09(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{84, -6, 11, -4, 89, -11, 2})) == (ListSet.fromIterable(List#{84, -6, -4, 2}), ListSet.fromIterable(List#{11, 89, -11})) + @Test + def partition09(): Unit \ Assert = Assert.assertEq(expected = (ListSet.fromIterable(List#{84, -6, -4, 2}), ListSet.fromIterable(List#{11, 89, -11})), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{84, -6, 11, -4, 89, -11, 2}))) - @test - def partition10(): Bool = ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8})) == (ListSet.fromIterable(List#{2, 4, 6, 8}), ListSet.fromIterable(List#{1, 3, 5, 7})) + @Test + def partition10(): Unit \ Assert = Assert.assertEq(expected = (ListSet.fromIterable(List#{2, 4, 6, 8}), ListSet.fromIterable(List#{1, 3, 5, 7})), ListSet.partition(x -> x `Int32.remainder` 2 == 0, ListSet.fromIterable(List#{1, 2, 3, 4, 5, 6, 7, 8}))) ///////////////////////////////////////////////////////////////////////////// // toOrderedSet // ///////////////////////////////////////////////////////////////////////////// - @test - def toOrderedSet01(): Bool = ListSet.toOrderedSet(x -> x, (ListSet.empty(): ListSet[Unit])) == Set#{} + @Test + def toOrderedSet01(): Unit \ Assert = Assert.assertEq(expected = Set#{}, ListSet.toOrderedSet(x -> x, (ListSet.empty(): ListSet[Unit]))) - @test - def toOrderedSet02(): Bool = ListSet.toOrderedSet(x -> x, ListSet.singleton(1)) == Set#{1} + @Test + def toOrderedSet02(): Unit \ Assert = Assert.assertEq(expected = Set#{1}, ListSet.toOrderedSet(x -> x, ListSet.singleton(1))) - @test - def toOrderedSet03(): Bool = ListSet.toOrderedSet(x -> x, ListSet.fromIterable(List#{1, 2})) == Set#{1, 2} + @Test + def toOrderedSet03(): Unit \ Assert = Assert.assertEq(expected = Set#{1, 2}, ListSet.toOrderedSet(x -> x, ListSet.fromIterable(List#{1, 2}))) - @test - def toOrderedSet04(): Bool = ListSet.toOrderedSet(x -> x, ListSet.fromIterable(List#{1, 2, 3})) == Set#{1, 2, 3} + @Test + def toOrderedSet04(): Unit \ Assert = Assert.assertEq(expected = Set#{1, 2, 3}, ListSet.toOrderedSet(x -> x, ListSet.fromIterable(List#{1, 2, 3}))) ///////////////////////////////////////////////////////////////////////////// // eq // ///////////////////////////////////////////////////////////////////////////// - @test - def eq01(): Bool = (ListSet.empty(): ListSet[Unit]) == ListSet.empty() + @Test + def eq01(): Unit \ Assert = Assert.assertEq(expected = ListSet.empty(), (ListSet.empty(): ListSet[Unit])) - @test - def eq02(): Bool = ListSet.singleton(1) != ListSet.empty() + @Test + def eq02(): Unit \ Assert = Assert.assertFalse(ListSet.singleton(1) == ListSet.empty()) - @test - def eq03(): Bool = ListSet.empty() != ListSet.singleton(1) + @Test + def eq03(): Unit \ Assert = Assert.assertFalse(ListSet.empty() == ListSet.singleton(1)) - @test - def eq04(): Bool = ListSet.fromIterable(List#{1, 2}) != ListSet.empty() + @Test + def eq04(): Unit \ Assert = Assert.assertFalse(ListSet.fromIterable(List#{1, 2}) == ListSet.empty()) - @test - def eq05(): Bool = ListSet.empty() != ListSet.fromIterable(List#{1, 2}) + @Test + def eq05(): Unit \ Assert = Assert.assertFalse(ListSet.empty() == ListSet.fromIterable(List#{1, 2})) - @test - def eq06(): Bool = ListSet.singleton(1) != ListSet.singleton(2) + @Test + def eq06(): Unit \ Assert = Assert.assertFalse(ListSet.singleton(1) == ListSet.singleton(2)) - @test - def eq07(): Bool = ListSet.singleton(1) == ListSet.singleton(1) + @Test + def eq07(): Unit \ Assert = Assert.assertEq(expected = ListSet.singleton(1), ListSet.singleton(1)) - @test - def eq08(): Bool = ListSet.fromIterable(List#{1, 2, 3}) != ListSet.empty() + @Test + def eq08(): Unit \ Assert = Assert.assertFalse(ListSet.fromIterable(List#{1, 2, 3}) == ListSet.empty()) - @test - def eq09(): Bool = ListSet.fromIterable(List#{1, 2}) != ListSet.singleton(1) + @Test + def eq09(): Unit \ Assert = Assert.assertFalse(ListSet.fromIterable(List#{1, 2}) == ListSet.singleton(1)) - @test - def eq10(): Bool = ListSet.singleton(1) != ListSet.fromIterable(List#{1, 2}) + @Test + def eq10(): Unit \ Assert = Assert.assertFalse(ListSet.singleton(1) == ListSet.fromIterable(List#{1, 2})) - @test - def eq11(): Bool = ListSet.empty() != ListSet.fromIterable(List#{1, 2, 3}) + @Test + def eq11(): Unit \ Assert = Assert.assertFalse(ListSet.empty() == ListSet.fromIterable(List#{1, 2, 3})) - @test - def eq12(): Bool = ListSet.fromIterable(List#{1, 2}) != ListSet.fromIterable(List#{1, 3}) + @Test + def eq12(): Unit \ Assert = Assert.assertFalse(ListSet.fromIterable(List#{1, 2}) == ListSet.fromIterable(List#{1, 3})) - @test - def eq13(): Bool = ListSet.fromIterable(List#{1, 2}) == ListSet.fromIterable(List#{2, 1}) + @Test + def eq13(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{2, 1}), ListSet.fromIterable(List#{1, 2})) - @test - def eq14(): Bool = ListSet.fromIterable(List#{1, 2}) == ListSet.fromIterable(List#{1, 2}) + @Test + def eq14(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{1, 2})) - @test - def eq15(): Bool = ListSet.fromIterable(List#{1, 2, 3}) != ListSet.fromIterable(List#{1, 2, 4}) + @Test + def eq15(): Unit \ Assert = Assert.assertFalse(ListSet.fromIterable(List#{1, 2, 3}) == ListSet.fromIterable(List#{1, 2, 4})) - @test - def eq16(): Bool = ListSet.fromIterable(List#{1, 2, 3}) == ListSet.fromIterable(List#{1, 2, 3}) + @Test + def eq16(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{1, 2, 3}), ListSet.fromIterable(List#{1, 2, 3})) - @test - def eq17(): Bool = ListSet.fromIterable(List#{1, 2, 3}) == ListSet.fromIterable(List#{2, 3, 1}) + @Test + def eq17(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{2, 3, 1}), ListSet.fromIterable(List#{1, 2, 3})) - @test - def eq18(): Bool = ListSet.fromIterable(List#{1, 2, 3}) == ListSet.fromIterable(List#{3, 1, 2}) + @Test + def eq18(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{3, 1, 2}), ListSet.fromIterable(List#{1, 2, 3})) - @test - def eq19(): Bool = ListSet.fromIterable(List#{1, 2, 3}) == ListSet.fromIterable(List#{2, 1, 3}) + @Test + def eq19(): Unit \ Assert = Assert.assertEq(expected = ListSet.fromIterable(List#{2, 1, 3}), ListSet.fromIterable(List#{1, 2, 3})) ///////////////////////////////////////////////////////////////////////////// // unfold // ///////////////////////////////////////////////////////////////////////////// - @test - def unfold01(): Bool = - ListSet.unfold(s -> if (true) None else Some((s + 48, s + 1)), 0) == ListSet.empty() + @Test + def unfold01(): Unit \ Assert = + Assert.assertEq(expected = ListSet.empty(), ListSet.unfold(s -> if (true) None else Some((s + 48, s + 1)), 0)) - @test - def unfold02(): Bool = - ListSet.unfold(s -> if (s > 0) None else Some((s + 48, s + 1)), 0) == ListSet.singleton(48) + @Test + def unfold02(): Unit \ Assert = + Assert.assertEq(expected = ListSet.singleton(48), ListSet.unfold(s -> if (s > 0) None else Some((s + 48, s + 1)), 0)) - @test - def unfold03(): Bool = - ListSet.unfold(s -> if (s > 1) None else Some((s + 48, s + 1)), 0) == ListSet.fromIterable(List#{48, 49}) + @Test + def unfold03(): Unit \ Assert = + Assert.assertEq(expected = ListSet.fromIterable(List#{48, 49}), ListSet.unfold(s -> if (s > 1) None else Some((s + 48, s + 1)), 0)) - @test - def unfold04(): Bool = - ListSet.unfold(s -> if (s >= 10) None else Some((s + 48, s + 1)), 0) == ListSet.fromIterable(List#{48, 49, 50, 51, 52, 53, 54, 55, 56, 57}) + @Test + def unfold04(): Unit \ Assert = + Assert.assertEq(expected = ListSet.fromIterable(List#{48, 49, 50, 51, 52, 53, 54, 55, 56, 57}), ListSet.unfold(s -> if (s >= 10) None else Some((s + 48, s + 1)), 0)) - @test - def unfold05(): Bool = - ListSet.unfold(s -> if (s >= 10) None else Some((s + 48, s + 1)), 5) == ListSet.fromIterable(List#{53, 54, 55, 56, 57}) + @Test + def unfold05(): Unit \ Assert = + Assert.assertEq(expected = ListSet.fromIterable(List#{53, 54, 55, 56, 57}), ListSet.unfold(s -> if (s >= 10) None else Some((s + 48, s + 1)), 5)) - @test - def unfold06(): Bool = - ListSet.unfold(s -> if (s >= 10) None else Some((s + 48, s + 2)), 0) == ListSet.fromIterable(List#{48, 50, 52, 54, 56}) + @Test + def unfold06(): Unit \ Assert = + Assert.assertEq(expected = ListSet.fromIterable(List#{48, 50, 52, 54, 56}), ListSet.unfold(s -> if (s >= 10) None else Some((s + 48, s + 2)), 0)) ///////////////////////////////////////////////////////////////////////////// // unfoldWithIter // ///////////////////////////////////////////////////////////////////////////// - @test - def unfoldWithIter01(): Bool = region rc { + @Test + def unfoldWithIter01(): Unit \ Assert = region rc { let x = Ref.fresh(rc, 0); let step = () -> if (true) @@ -943,11 +943,11 @@ mod JonathanStarup.Test.TestListSet { Ref.put(Ref.get(x) + 1, x); c }; - ListSet.unfoldWithIter(step) == ListSet.empty() + Assert.assertEq(expected = ListSet.empty(), ListSet.unfoldWithIter(step)) } - @test - def unfoldWithIter02(): Bool = region rc { + @Test + def unfoldWithIter02(): Unit \ Assert = region rc { let x = Ref.fresh(rc, 0); let step = () -> if (Ref.get(x) > 0) @@ -957,11 +957,11 @@ mod JonathanStarup.Test.TestListSet { Ref.put(Ref.get(x) + 1, x); c }; - ListSet.unfoldWithIter(step) == ListSet.singleton(48) + Assert.assertEq(expected = ListSet.singleton(48), ListSet.unfoldWithIter(step)) } - @test - def unfoldWithIter03(): Bool = region rc { + @Test + def unfoldWithIter03(): Unit \ Assert = region rc { let x = Ref.fresh(rc, 0); let step = () -> if (Ref.get(x) > 1) @@ -971,11 +971,11 @@ mod JonathanStarup.Test.TestListSet { Ref.put(Ref.get(x) + 1, x); c }; - ListSet.unfoldWithIter(step) == ListSet.fromIterable(List#{48, 49}) + Assert.assertEq(expected = ListSet.fromIterable(List#{48, 49}), ListSet.unfoldWithIter(step)) } - @test - def unfoldWithIter04(): Bool = region rc { + @Test + def unfoldWithIter04(): Unit \ Assert = region rc { let x = Ref.fresh(rc, 0); let step = () -> if (Ref.get(x) >= 10) @@ -985,11 +985,11 @@ mod JonathanStarup.Test.TestListSet { Ref.put(Ref.get(x) + 1, x); c }; - ListSet.unfoldWithIter(step) == ListSet.fromIterable(List#{48, 49, 50, 51, 52, 53, 54, 55, 56, 57}) + Assert.assertEq(expected = ListSet.fromIterable(List#{48, 49, 50, 51, 52, 53, 54, 55, 56, 57}), ListSet.unfoldWithIter(step)) } - @test - def unfoldWithIter05(): Bool = region rc { + @Test + def unfoldWithIter05(): Unit \ Assert = region rc { let x = Ref.fresh(rc, 5); let step = () -> if (Ref.get(x) >= 10) @@ -999,11 +999,11 @@ mod JonathanStarup.Test.TestListSet { Ref.put(Ref.get(x) + 1, x); c }; - ListSet.unfoldWithIter(step) == ListSet.fromIterable(List#{53, 54, 55, 56, 57}) + Assert.assertEq(expected = ListSet.fromIterable(List#{53, 54, 55, 56, 57}), ListSet.unfoldWithIter(step)) } - @test - def unfoldWithIter06(): Bool = region rc { + @Test + def unfoldWithIter06(): Unit \ Assert = region rc { let x = Ref.fresh(rc, 0); let step = () -> if (Ref.get(x) >= 10) @@ -1013,63 +1013,63 @@ mod JonathanStarup.Test.TestListSet { Ref.put(Ref.get(x) + 2, x); c }; - ListSet.unfoldWithIter(step) == ListSet.fromIterable(List#{48, 50, 52, 54, 56}) + Assert.assertEq(expected = ListSet.fromIterable(List#{48, 50, 52, 54, 56}), ListSet.unfoldWithIter(step)) } ///////////////////////////////////////////////////////////////////////////// // toString // ///////////////////////////////////////////////////////////////////////////// - @test - def toString01(): Bool = - toString(ListSet.singleton(1)) == "ListSet(1)" + @Test + def toString01(): Unit \ Assert = + Assert.assertEq(expected = "ListSet(1)", toString(ListSet.singleton(1))) - @test - def toString02(): Bool = - toString(ListSet.fromIterable(List#{1, 2, 3})) == "ListSet(3, 2, 1)" + @Test + def toString02(): Unit \ Assert = + Assert.assertEq(expected = "ListSet(3, 2, 1)", toString(ListSet.fromIterable(List#{1, 2, 3}))) - @test - def toString03(): Bool = - toString(ListSet.fromIterable(List#{1, 2})) == "ListSet(2, 1)" + @Test + def toString03(): Unit \ Assert = + Assert.assertEq(expected = "ListSet(2, 1)", toString(ListSet.fromIterable(List#{1, 2}))) - @test - def toString04(): Bool = - toString(ListSet.fromIterable(List#{97, 2, 3, 4, 0})) == "ListSet(0, 4, 3, 2, 97)" + @Test + def toString04(): Unit \ Assert = + Assert.assertEq(expected = "ListSet(0, 4, 3, 2, 97)", toString(ListSet.fromIterable(List#{97, 2, 3, 4, 0}))) - @test - def toString05(): Bool = - toString(ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{4, 6})})) == "ListSet(ListSet(6, 4), ListSet(2, 1))" + @Test + def toString05(): Unit \ Assert = + Assert.assertEq(expected = "ListSet(ListSet(6, 4), ListSet(2, 1))", toString(ListSet.fromIterable(List#{ListSet.fromIterable(List#{1, 2}), ListSet.fromIterable(List#{4, 6})}))) ///////////////////////////////////////////////////////////////////////////// // minimumBy // ///////////////////////////////////////////////////////////////////////////// - @test - def minimumBy01(): Bool = ListSet.minimumBy((x, y) -> x <=> y, (ListSet.empty(): ListSet[Int32])) == None + @Test + def minimumBy01(): Unit \ Assert = Assert.assertEq(expected = None, ListSet.minimumBy((x, y) -> x <=> y, (ListSet.empty(): ListSet[Int32]))) - @test - def minimumBy02(): Bool = ListSet.minimumBy((x, y) -> x <=> y, ListSet.singleton(1)) == Some(1) + @Test + def minimumBy02(): Unit \ Assert = Assert.assertEq(expected = Some(1), ListSet.minimumBy((x, y) -> x <=> y, ListSet.singleton(1))) - @test - def minimumBy03(): Bool = ListSet.minimumBy((x, y) -> x <=> y, ListSet.fromIterable(List#{1, 2, 3, 0})) == Some(0) + @Test + def minimumBy03(): Unit \ Assert = Assert.assertEq(expected = Some(0), ListSet.minimumBy((x, y) -> x <=> y, ListSet.fromIterable(List#{1, 2, 3, 0}))) - @test - def minimumBy04(): Bool = ListSet.minimumBy((x, y) -> x <=> y, ListSet.range(5, 55)) == Some(5) + @Test + def minimumBy04(): Unit \ Assert = Assert.assertEq(expected = Some(5), ListSet.minimumBy((x, y) -> x <=> y, ListSet.range(5, 55))) ///////////////////////////////////////////////////////////////////////////// // maximumBy // ///////////////////////////////////////////////////////////////////////////// - @test - def maximumBy01(): Bool = ListSet.maximumBy((x, y) -> x <=> y, (ListSet.empty(): ListSet[Int32])) == None + @Test + def maximumBy01(): Unit \ Assert = Assert.assertEq(expected = None, ListSet.maximumBy((x, y) -> x <=> y, (ListSet.empty(): ListSet[Int32]))) - @test - def maximumBy02(): Bool = ListSet.maximumBy((x, y) -> x <=> y, ListSet.singleton(1)) == Some(1) + @Test + def maximumBy02(): Unit \ Assert = Assert.assertEq(expected = Some(1), ListSet.maximumBy((x, y) -> x <=> y, ListSet.singleton(1))) - @test - def maximumBy03(): Bool = ListSet.maximumBy((x, y) -> x <=> y, ListSet.fromIterable(List#{1, 2, 3, 0})) == Some(3) + @Test + def maximumBy03(): Unit \ Assert = Assert.assertEq(expected = Some(3), ListSet.maximumBy((x, y) -> x <=> y, ListSet.fromIterable(List#{1, 2, 3, 0}))) - @test - def maximumBy04(): Bool = ListSet.maximumBy((x, y) -> x <=> y, ListSet.range(5, 55)) == Some(54) + @Test + def maximumBy04(): Unit \ Assert = Assert.assertEq(expected = Some(54), ListSet.maximumBy((x, y) -> x <=> y, ListSet.range(5, 55))) }