diff options
author | tynanbe <contact@tynan.be> | 2023-11-16 08:09:15 -0600 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2023-11-18 10:33:46 +0000 |
commit | aec149b434c1ca537c2fe9d307113c226413e035 (patch) | |
tree | ba3df58176fa82e62a1da99c83bab60726981975 /test | |
parent | b4c688a6b04aabae4ee5a64846cb223e7f8d4cc9 (diff) | |
download | gleam_stdlib-aec149b434c1ca537c2fe9d307113c226413e035.tar.gz gleam_stdlib-aec149b434c1ca537c2fe9d307113c226413e035.zip |
Panic on bool.lazy_guard test branches that shouldn't run
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/bool_test.gleam | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/gleam/bool_test.gleam b/test/gleam/bool_test.gleam index 964aab1..71359a7 100644 --- a/test/gleam/bool_test.gleam +++ b/test/gleam/bool_test.gleam @@ -169,13 +169,15 @@ pub fn guard_test() { } pub fn lazy_guard_test() { + let oops = fn() { panic as "this shouldn't run!" } + let assert 2 = { - use <- bool.lazy_guard(when: True, return: fn() { 2 }) - 1 + use <- bool.lazy_guard(when: True, otherwise: oops) + 2 } let assert 1 = { - use <- bool.lazy_guard(when: False, return: fn() { 2 }) + use <- bool.lazy_guard(when: False, return: oops) 1 } } |