diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/string_test.gleam | 14 | ||||
-rw-r--r-- | test/utf_codepoint_test.gleam | 16 |
2 files changed, 14 insertions, 16 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam index 682dc94..2d563b4 100644 --- a/test/gleam/string_test.gleam +++ b/test/gleam/string_test.gleam @@ -295,3 +295,17 @@ pub fn to_graphemes_test() { |> string.to_graphemes() |> should.equal([]) } + +pub fn utf_codepoint_test() { + string.utf_codepoint(1114444) + |> should.be_error + + string.utf_codepoint(65534) + |> should.be_error + + string.utf_codepoint(55296) + |> should.be_error + + assert Ok(snake) = string.utf_codepoint(128013) + should.equal(<<snake:utf8_codepoint>>, <<"🐍":utf8>>) +} diff --git a/test/utf_codepoint_test.gleam b/test/utf_codepoint_test.gleam deleted file mode 100644 index a3747ba..0000000 --- a/test/utf_codepoint_test.gleam +++ /dev/null @@ -1,16 +0,0 @@ -import gleam/should -import gleam/utf_codepoint - -pub fn from_int_test() { - utf_codepoint.from_int(1114444) - |> should.be_error - - utf_codepoint.from_int(65534) - |> should.be_error - - utf_codepoint.from_int(55296) - |> should.be_error - - assert Ok(snake) = utf_codepoint.from_int(128013) - should.equal(<<snake:utf8_codepoint>>, <<"🐍":utf8>>) -} |