diff options
Diffstat (limited to 'tests/mason-core/functional/string_spec.lua')
| -rw-r--r-- | tests/mason-core/functional/string_spec.lua | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/mason-core/functional/string_spec.lua b/tests/mason-core/functional/string_spec.lua index 02062f4c..30dea069 100644 --- a/tests/mason-core/functional/string_spec.lua +++ b/tests/mason-core/functional/string_spec.lua @@ -55,7 +55,22 @@ Ipsum assert.equals("HELLO!", _.trim " HELLO! ") end) - it("trim_starts strings", function() - assert.equals("HELLO! ", _.trim_start("%s", " HELLO! ")) + it("should trim_start strings", function() + assert.equals("HELLO! ", _.trim_start_matches("%s", " HELLO! ")) + end) + + it("should trim_end strings", function() + assert.equals(" HELLO!", _.trim_end_matches("%s", " HELLO! ")) + end) + + it("should strip_prefix", function() + assert.equals("withthewind", _.strip_prefix("gone", "gonewiththewind")) + assert.equals("1.3.0", _.strip_prefix("v", "v1.3.0")) + end) + + it("should strip_suffix", function() + assert.equals("gone", _.strip_suffix("withtthewind", "gonewithtthewind")) + assert.equals("name", _.strip_suffix("%.tar%.gz", "name.tar.gz")) + assert.equals("name", _.strip_suffix(".tar.*", "name.tar.gz")) end) end) |
