diff options
Diffstat (limited to 'tests/mason-core/functional/string_spec.lua')
| -rw-r--r-- | tests/mason-core/functional/string_spec.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/mason-core/functional/string_spec.lua b/tests/mason-core/functional/string_spec.lua index 30dea069..9ceb38e8 100644 --- a/tests/mason-core/functional/string_spec.lua +++ b/tests/mason-core/functional/string_spec.lua @@ -66,11 +66,20 @@ Ipsum it("should strip_prefix", function() assert.equals("withthewind", _.strip_prefix("gone", "gonewiththewind")) assert.equals("1.3.0", _.strip_prefix("v", "v1.3.0")) + assert.equals("-30", _.strip_prefix("2023-05", "2023-05-30")) + assert.equals("The same", _.strip_prefix("Not Equals", "The same")) + assert.equals("long_pattern", _.strip_prefix("long_pattern_here", "long_pattern")) + assert.equals("", _.strip_prefix("pattern_here", "pattern_here")) + assert.equals("s", _.strip_prefix("pattern_here", "pattern_heres")) 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")) + assert.equals("name", _.strip_suffix(".tar.gz", "name.tar.gz")) + assert.equals("2023", _.strip_suffix("-05-30", "2023-05-30")) + assert.equals("The same", _.strip_suffix("Not Equals", "The same")) + assert.equals("pattern_here", _.strip_suffix("long_pattern_here", "pattern_here")) + assert.equals("", _.strip_suffix("pattern_here", "pattern_here")) + assert.equals("s", _.strip_suffix("pattern_here", "spattern_here")) end) end) |
