aboutsummaryrefslogtreecommitdiff
path: root/test/minmax.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-21 17:44:08 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-21 17:44:08 -0400
commitc941b9a3325228eba404455afea7ccea0da45095 (patch)
treed4ca88c6848ac2e6ceee635bb87add87ba6d2322 /test/minmax.tm
parent1cec086a6034ad546977cae7aeaf4bb876d21970 (diff)
Fix tests
Diffstat (limited to 'test/minmax.tm')
-rw-r--r--test/minmax.tm22
1 files changed, 7 insertions, 15 deletions
diff --git a/test/minmax.tm b/test/minmax.tm
index 8ffb401e..038f03e4 100644
--- a/test/minmax.tm
+++ b/test/minmax.tm
@@ -4,24 +4,16 @@ struct Foo(x:Int, y:Int)
return Num.sqrt(Num(f.x*f.x + f.y*f.y))!
func main()
- >> 3 _min_ 5
- = 3
- >> 5 _min_ 3
- = 3
+ assert (3 _min_ 5) == 3
+ assert (5 _min_ 3) == 3
- >> Foo(5, 1) _min_ Foo(5, 999)
- = Foo(x=5, y=1)
+ assert (Foo(5, 1) _min_ Foo(5, 999)) == Foo(x=5, y=1)
- >> Foo(5, 999) _min_.x Foo(5, 1)
- = Foo(x=5, y=999)
+ assert (Foo(5, 999) _min_.x Foo(5, 1)) == Foo(x=5, y=999)
- >> Foo(999, 1) _min_.y Foo(1, 10)
- = Foo(x=999, y=1)
-
- >> Foo(-999, -999) _max_.len() Foo(10, 10)
- = Foo(x=-999, y=-999)
+ assert (Foo(999, 1) _min_.y Foo(1, 10)) == Foo(x=999, y=1)
+ assert (Foo(-999, -999) _max_.len() Foo(10, 10)) == Foo(x=-999, y=-999)
>> foos := [Foo(5, 1), Foo(5, 99), Foo(-999, -999)]
- >> (_max_: foos)!
- = Foo(x=5, y=99)
+ assert (_max_: foos)! == Foo(x=5, y=99)