diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-07-11 16:05:30 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-07-11 16:05:30 -0400 |
| commit | 46b0dbc5a448249ddc9a6ce20465f0fa41de6d64 (patch) | |
| tree | a353513c1fdb95baa2d225fa50972be3c9d11d4e /test/structs.tm | |
| parent | 4834f3355d3b0355cb6ff7774d18e86ca0f5e38e (diff) | |
Use `assert` more in tests to give better error messages
Diffstat (limited to 'test/structs.tm')
| -rw-r--r-- | test/structs.tm | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/test/structs.tm b/test/structs.tm index c340f1c9..a58a9ef7 100644 --- a/test/structs.tm +++ b/test/structs.tm @@ -15,23 +15,18 @@ func test_literals() = Pair(x=10, y=20) >> y := Pair(y=20, 10) = Pair(x=10, y=20) - >> x == y - = yes - >> x == Pair(-1, -2) - = no + assert x == y + assert x != Pair(-1, -2) func test_metamethods() >> x := Pair(10, 20) >> y := Pair(100, 200) >> x == y = no - >> x == Pair(10, 20) - = yes - >> x == Pair(10, 30) - = no + assert x == Pair(10, 20) + assert x != Pair(10, 30) - >> x < Pair(11, 20) - = yes + assert x < Pair(11, 20) >> set := |x| >> set.has(x) = yes @@ -43,12 +38,9 @@ func test_mixed() >> y := Mixed(99, "Hello") >> x == y = no - >> x == Mixed(10, "Hello") - = yes - >> x == Mixed(10, "Bye") - = no - >> x < Mixed(11, "Hello") - = yes + assert x == Mixed(10, "Hello") + assert x != Mixed(10, "Bye") + assert x < Mixed(11, "Hello") >> set := |x| >> set.has(x) = yes |
