diff options
author | Erik Terpstra <erterpstra@gmail.com> | 2020-05-20 09:34:52 +0200 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2020-05-22 12:47:08 +0100 |
commit | 088ed8c9fcaaab0a434a29eb26175d4452f4b179 (patch) | |
tree | 9523b08edbb5f818c2eb1e416becd92ef554fec0 /test | |
parent | 2109886ed8a7fc9aae1a2f5f9fb4e85cc29f49e5 (diff) | |
download | gleam_stdlib-088ed8c9fcaaab0a434a29eb26175d4452f4b179.tar.gz gleam_stdlib-088ed8c9fcaaab0a434a29eb26175d4452f4b179.zip |
string.next_grapheme
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)) +} |