From 7b67ae1502b10edbb1589b831db1d8d856dc9b88 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Tue, 22 Feb 2022 17:47:02 +0000 Subject: result.unwrap_both --- test/gleam/result_test.gleam | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') 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 }) -- cgit v1.2.3