diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/string_test.gleam | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam index 01e95eb..03678ea 100644 --- a/test/gleam/string_test.gleam +++ b/test/gleam/string_test.gleam @@ -127,3 +127,39 @@ pub fn trim_right_test() { |> string.trim_right() |> should.equal(" hats") } + +pub fn starts_with_test(){ + "theory" + |> string.starts_with("") + |> should.equal(True) + + "theory" + |> string.starts_with("the") + |> should.equal(True) + + "theory" + |> string.starts_with("ory") + |> should.equal(False) + + "theory" + |> string.starts_with("theory2") + |> should.equal(False) +} + +pub fn ends_with_test() { + "theory" + |> string.ends_with("") + |> should.equal(True) + + "theory" + |> string.ends_with("ory") + |> should.equal(True) + + "theory" + |> string.ends_with("the") + |> should.equal(False) + + "theory" + |> string.ends_with("theory2") + |> should.equal(False) +} |