diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-07 12:18:01 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-07 12:18:01 -0500 |
| commit | 6583221c0b46dd638e61a7b055c1b51922f38e7b (patch) | |
| tree | adc2029eb7ceb23609e5b834bd5d4d7b601864f4 /test/minmax.tm | |
| parent | fa66053e13c39e6f6a25db8f46b1e1f97ecce2fc (diff) | |
More tests
Diffstat (limited to 'test/minmax.tm')
| -rw-r--r-- | test/minmax.tm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/minmax.tm b/test/minmax.tm new file mode 100644 index 00000000..58d9661d --- /dev/null +++ b/test/minmax.tm @@ -0,0 +1,26 @@ + +>> 3 _min_ 5 += 3 +>> 5 _min_ 3 += 3 + +struct Foo(x:Int, y:Int) + func len(f:Foo)->Num + return Num.sqrt(f.x*f.x + f.y*f.y) + +>> 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) + +>> 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) + + +>> foos := [Foo(5, 1), Foo(5, 99), Foo(-999, -999)] +>> (_max_) foos += Foo(x=5, y=99) |
