diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 17:44:08 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 17:44:08 -0400 |
| commit | c941b9a3325228eba404455afea7ccea0da45095 (patch) | |
| tree | d4ca88c6848ac2e6ceee635bb87add87ba6d2322 /test/lambdas.tm | |
| parent | 1cec086a6034ad546977cae7aeaf4bb876d21970 (diff) | |
Fix tests
Diffstat (limited to 'test/lambdas.tm')
| -rw-r--r-- | test/lambdas.tm | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/test/lambdas.tm b/test/lambdas.tm index d6501cb7..1d1b2775 100644 --- a/test/lambdas.tm +++ b/test/lambdas.tm @@ -9,27 +9,22 @@ func mul_func(n:Int, fn:func(x:Int->Int) -> func(x:Int->Int)) func main() >> add_one := func(x:Int) x + 1 - >> add_one(10) - = 11 + assert add_one(10) == 11 >> shout := func(msg:Text) say("$(msg.upper())!") >> shout("hello") >> asdf := add_one - >> asdf(99) - = 100 + assert asdf(99) == 100 >> add_100 := make_adder(100) - >> add_100(5) - = 105 + assert add_100(5) == 105 >> shout2 := suffix_fn(func(t:Text) t.upper(), "!") - >> shout2("hello") - = "HELLO!" + assert shout2("hello") == "HELLO!" >> abs100 := mul_func(100, Int.abs) - >> abs100(-5) - = 500 + assert abs100(-5) == 500 # Test nested lambdas: outer := "Hello" @@ -38,5 +33,4 @@ func main() return func() defer say("$outer") return outer - >> fn()()() - = "Hello" + assert fn()()() == "Hello" |
