diff options
author | Louis Pilfold <louis@lpil.uk> | 2021-08-23 16:01:48 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2021-08-23 16:01:48 +0100 |
commit | a5ca2d8bdefb677c4c4dfac2bfe58149ff195a7e (patch) | |
tree | f701ed0c20006a16675625db36cbea4c76c5d843 /test | |
parent | 89c5655794e04aae3488d022185250e2ffd1d06c (diff) | |
download | gleam_stdlib-a5ca2d8bdefb677c4c4dfac2bfe58149ff195a7e.tar.gz gleam_stdlib-a5ca2d8bdefb677c4c4dfac2bfe58149ff195a7e.zip |
string.to_option
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/string_test.gleam | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam index 3612dbb..d3a8496 100644 --- a/test/gleam/string_test.gleam +++ b/test/gleam/string_test.gleam @@ -1,6 +1,7 @@ import gleam/string import gleam/should import gleam/order +import gleam/option.{None, Some} import gleam/io import gleam/bit_string @@ -355,3 +356,13 @@ pub fn bit_string_utf_codepoint_test() { assert Ok(snake) = string.utf_codepoint(128013) should.equal(<<snake:utf8_codepoint>>, <<"🐍":utf8>>) } + +pub fn to_option_test() { + "" + |> string.to_option + |> should.equal(None) + + "ok" + |> string.to_option + |> should.equal(Some("ok")) +} |