aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAl Dee <amyalicedee@gmail.com>2020-05-22 20:13:11 +0100
committerLouis Pilfold <louis@lpil.uk>2020-05-26 19:19:29 +0100
commit7af5bc63628bc5ccc45fe093810292c37b354ea4 (patch)
tree4a77cf45955bddb81c260695185c94994c459033 /test
parent74b8029a37bc1d5470a19a6effa67763dcc32994 (diff)
downloadgleam_stdlib-7af5bc63628bc5ccc45fe093810292c37b354ea4.tar.gz
gleam_stdlib-7af5bc63628bc5ccc45fe093810292c37b354ea4.zip
Add unwrap function to option module
Diffstat (limited to 'test')
-rw-r--r--test/gleam/option_test.gleam8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/gleam/option_test.gleam b/test/gleam/option_test.gleam
index a6f2cc3..e41c221 100644
--- a/test/gleam/option_test.gleam
+++ b/test/gleam/option_test.gleam
@@ -32,3 +32,11 @@ pub fn from_result_test() {
option.from_result(Error("some_error"))
|> should.equal(None)
}
+
+pub fn unwrap_option_test() {
+ option.unwrap(Some(1), 0)
+ |> should.equal(1)
+
+ option.unwrap(None, 0)
+ |> should.equal(0)
+}