aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gleam/string_test.gleam21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam
index 2d563b4..b0e0fe6 100644
--- a/test/gleam/string_test.gleam
+++ b/test/gleam/string_test.gleam
@@ -204,6 +204,27 @@ pub fn slice_test() {
|> should.equal("")
}
+pub fn drop_before_test() {
+ "gleam"
+ |> string.drop_before("gl")
+ |> should.equal("gleam")
+
+ "gleam"
+ |> string.drop_before("le")
+ |> should.equal("leam")
+
+ string.drop_before(from: "gleam", before: "ea")
+ |> should.equal("eam")
+
+ "gleam"
+ |> string.drop_before("")
+ |> should.equal("gleam")
+
+ "gleam"
+ |> string.drop_before("!")
+ |> should.equal("gleam")
+}
+
pub fn drop_left_test() {
"gleam"
|> string.drop_left(up_to: 2)