aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortynanbe <contact@tynan.be>2023-11-14 12:54:11 -0600
committerLouis Pilfold <louis@lpil.uk>2023-11-18 10:33:46 +0000
commitb4c688a6b04aabae4ee5a64846cb223e7f8d4cc9 (patch)
treea637cac794bf75e46c17a4a22c069cb053b2c7b3 /test
parentd7db6233534f2cc7688f8c52081f5db4cf4da14a (diff)
downloadgleam_stdlib-b4c688a6b04aabae4ee5a64846cb223e7f8d4cc9.tar.gz
gleam_stdlib-b4c688a6b04aabae4ee5a64846cb223e7f8d4cc9.zip
Add bool.lazy_guard
Diffstat (limited to 'test')
-rw-r--r--test/gleam/bool_test.gleam12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/gleam/bool_test.gleam b/test/gleam/bool_test.gleam
index 7e0cf05..964aab1 100644
--- a/test/gleam/bool_test.gleam
+++ b/test/gleam/bool_test.gleam
@@ -167,3 +167,15 @@ pub fn guard_test() {
1
}
}
+
+pub fn lazy_guard_test() {
+ let assert 2 = {
+ use <- bool.lazy_guard(when: True, return: fn() { 2 })
+ 1
+ }
+
+ let assert 1 = {
+ use <- bool.lazy_guard(when: False, return: fn() { 2 })
+ 1
+ }
+}