aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gleam/result_test.gleam10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/gleam/result_test.gleam b/test/gleam/result_test.gleam
index d047496..d7b6048 100644
--- a/test/gleam/result_test.gleam
+++ b/test/gleam/result_test.gleam
@@ -87,6 +87,16 @@ pub fn unwrap_test() {
|> should.equal(50)
}
+pub fn lazy_unwrap_test() {
+ Ok(1)
+ |> result.lazy_unwrap(fn() { 50 })
+ |> should.equal(1)
+
+ Error("nope")
+ |> result.lazy_unwrap(fn() { 50 })
+ |> should.equal(50)
+}
+
pub fn nil_error_test() {
Error("error_string")
|> result.nil_error