diff options
| author | William Boman <william@redwill.se> | 2023-06-13 15:45:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-13 15:45:34 +0200 |
| commit | f99b70233e49db2229350bb82d9ddc6e2f4131c0 (patch) | |
| tree | 6fe259fe17563f9c905333b489d265e277ff9c31 /tests | |
| parent | fix(async): always check channel state (#1351) (diff) | |
| download | mason-f99b70233e49db2229350bb82d9ddc6e2f4131c0.tar mason-f99b70233e49db2229350bb82d9ddc6e2f4131c0.tar.gz mason-f99b70233e49db2229350bb82d9ddc6e2f4131c0.tar.bz2 mason-f99b70233e49db2229350bb82d9ddc6e2f4131c0.tar.lz mason-f99b70233e49db2229350bb82d9ddc6e2f4131c0.tar.xz mason-f99b70233e49db2229350bb82d9ddc6e2f4131c0.tar.zst mason-f99b70233e49db2229350bb82d9ddc6e2f4131c0.zip | |
fix(functional): strip_prefix and strip_suffix should not use patterns (#1352)
Diffstat (limited to 'tests')
| -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) |
