diff options
author | Louis Pilfold <louis@lpil.uk> | 2022-02-22 17:47:02 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2022-02-22 17:47:02 +0000 |
commit | 7b67ae1502b10edbb1589b831db1d8d856dc9b88 (patch) | |
tree | 1307267f1d50457a3fbae6a66c9d8d17de76826f /test | |
parent | ddd0135d4bba20e29e1367c3bef8bb47a8dbb0a3 (diff) | |
download | gleam_stdlib-7b67ae1502b10edbb1589b831db1d8d856dc9b88.tar.gz gleam_stdlib-7b67ae1502b10edbb1589b831db1d8d856dc9b88.zip |
result.unwrap_both
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/result_test.gleam | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/gleam/result_test.gleam b/test/gleam/result_test.gleam index 79f1d6c..c580950 100644 --- a/test/gleam/result_test.gleam +++ b/test/gleam/result_test.gleam @@ -97,6 +97,16 @@ pub fn unwrap_error_test() { |> should.equal(50) } +pub fn unwrap_both_test() { + Error(1) + |> result.unwrap_both + |> should.equal(1) + + Ok("yup") + |> result.unwrap_both + |> should.equal("yup") +} + pub fn lazy_unwrap_test() { Ok(1) |> result.lazy_unwrap(fn() { 50 }) |