diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2026-02-13 12:36:15 +0100 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2026-02-13 12:36:15 +0100 |
| commit | faca11d5938c810fc6d448e9b89b47f48577b088 (patch) | |
| tree | 16729326ba7f35dbd88907b238be7c140e08e56f /tests | |
| parent | f8767e58c588643fa51b4dc899a4281fcaabe0e5 (diff) | |
Fix `os.stem`, `os.short_stem`.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/core/path/filepath/test_core_filepath.odin | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/core/path/filepath/test_core_filepath.odin b/tests/core/path/filepath/test_core_filepath.odin index a0de7e831..688259e9c 100644 --- a/tests/core/path/filepath/test_core_filepath.odin +++ b/tests/core/path/filepath/test_core_filepath.odin @@ -109,4 +109,27 @@ delete_split :: proc(s: []string) { delete(part) } delete(s) +} + +@(test) +test_stem :: proc(t: ^testing.T) { + @static stem := [][2]string{ + {"builder.tar.gz", "builder.tar"}, + {"./builder.tar.gz", "builder.tar"}, + {"./builder/", ""}, + } + + @static short_stem := [][2]string{ + {"builder.tar", "builder"}, + {"./builder.tar", "builder"}, + {"./builder/", ""}, + } + + for d in stem { + testing.expect_value(t, filepath.stem(d[0]), d[1]) + } + + for d in short_stem { + testing.expect_value(t, filepath.stem(d[0]), d[1]) + } }
\ No newline at end of file |