aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gleam/string_test.gleam30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam
index 8ad1080..14b034c 100644
--- a/test/gleam/string_test.gleam
+++ b/test/gleam/string_test.gleam
@@ -388,3 +388,33 @@ pub fn last_test() {
|> string.last
|> should.equal(Some(" "))
}
+
+pub fn capitalize_test() {
+ ""
+ |> string.capitalize
+ |> should.equal("")
+
+ "gleam"
+ |> string.capitalize
+ |> should.equal("Gleam")
+
+ "GLEAM"
+ |> string.capitalize
+ |> should.equal("Gleam")
+
+ "g l e a m"
+ |> string.capitalize
+ |> should.equal("G l e a m")
+
+ "1GLEAM"
+ |> string.capitalize
+ |> should.equal("1gleam")
+
+ "_gLeAm1"
+ |> string.capitalize
+ |> should.equal("_gleam1")
+
+ " gLeAm1"
+ |> string.capitalize
+ |> should.equal(" gleam1")
+}