aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gleam/string_test.gleam14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam
index a98a2e2..8ad1080 100644
--- a/test/gleam/string_test.gleam
+++ b/test/gleam/string_test.gleam
@@ -374,3 +374,17 @@ pub fn first_test() {
|> string.first
|> should.equal(Some("g"))
}
+
+pub fn last_test() {
+ ""
+ |> string.last
+ |> should.equal(None)
+
+ "gleam"
+ |> string.last
+ |> should.equal(Some("m"))
+
+ "gleam "
+ |> string.last
+ |> should.equal(Some(" "))
+}