From c941b9a3325228eba404455afea7ccea0da45095 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Sep 2025 17:44:08 -0400 Subject: Fix tests --- test/structs.tm | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'test/structs.tm') diff --git a/test/structs.tm b/test/structs.tm index 2440911b..fdf92d18 100644 --- a/test/structs.tm +++ b/test/structs.tm @@ -9,43 +9,36 @@ struct CorecursiveA(other:@CorecursiveB?) struct CorecursiveB(other:@CorecursiveA?=none) func test_literals() - >> Single(123) - = Single(123) - >> x := Pair(10, 20) - = Pair(x=10, y=20) - >> y := Pair(y=20, 10) - = Pair(x=10, y=20) + assert Single(123) == Single(123) + x := Pair(10, 20) + assert x == Pair(x=10, y=20) + y := Pair(y=20, 10) + assert y == Pair(x=10, y=20) assert x == y assert x != Pair(-1, -2) func test_metamethods() >> x := Pair(10, 20) >> y := Pair(100, 200) - >> x == y - = no + assert x == y == no assert x == Pair(10, 20) assert x != Pair(10, 30) assert x < Pair(11, 20) >> set := {x=yes} - >> set.has(x) - = yes - >> set.has(y) - = no + assert set.has(x) == yes + assert set.has(y) == no func test_mixed() >> x := Mixed(10, "Hello") >> y := Mixed(99, "Hello") - >> x == y - = no + assert x == y == no assert x == Mixed(10, "Hello") assert x != Mixed(10, "Bye") assert x < Mixed(11, "Hello") >> set := {x=yes} - >> set.has(x) - = yes - >> set.has(y) - = no + assert set.has(x) == yes + assert set.has(y) == no func test_text() >> b := @CorecursiveB() @@ -63,14 +56,11 @@ func main() >> @LinkedList(10, @LinkedList(20)) >> my_pass := Password("Swordfish") - = Password("Swordfish") - >> "$my_pass" - = "Password(...)" + assert my_pass == Password("Swordfish") + assert "$my_pass" == "Password(...)" >> users_by_password := {my_pass="User1", Password("xxx")="User2"} - >> "$users_by_password" - = '{Password(...)="User1", Password(...)="User2"}' - >> users_by_password[my_pass]! - = "User1" + assert "$users_by_password" == '{Password(...)="User1", Password(...)="User2"}' + assert users_by_password[my_pass]! == "User1" >> CorecursiveA(@CorecursiveB()) -- cgit v1.2.3