diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/string_test.gleam | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam index 0695749..c8eae63 100644 --- a/test/gleam/string_test.gleam +++ b/test/gleam/string_test.gleam @@ -253,3 +253,17 @@ pub fn pad_right_test() { |> string.pad_right(to: 5, with: "XY") |> should.equal("121XYXY") } + +pub fn pop_grapheme_test() { + "gleam" + |> string.pop_grapheme() + |> should.equal(Ok(tuple("g", "leam"))) + + "g" + |> string.pop_grapheme() + |> should.equal(Ok(tuple("g", ""))) + + "" + |> string.pop_grapheme() + |> should.equal(Error(Nil)) +} |