Closed ageron closed 1 month ago
Here's a shorter example, in a module:
# Inc.roc
module [inc]
inc = \i -> if i > 2 then Err TooBig else Ok (i + 1)
expect
result = inc? 0
result == 1
Just run roc test Inc.roc
🥳 thanks @lukewilliamboswell !
The following code fails with
roc nightly pre-release, built from commit 9a4d556 on Mon Sep 9 09:02:33 UTC 2024
:The error is:
The problem disappears if I define the
run
function outside theexpect
statement. However, I'd like to avoid polluting the global scope, and I'd like to keep the function tied to theexpect
statement.