aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2026-02-14 12:52:51 +0100
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2026-02-14 12:52:51 +0100
commit1af1beb248fe8796023f77c1a4b4a326e772ea5c (patch)
treef06c5a97b87e5c600d18075b6d498713f603aba6 /tests
parent67922a57e90c78992cbe85e10003bc5c05bc0453 (diff)
Fix filepath.dir
Diffstat (limited to 'tests')
-rw-r--r--tests/core/path/filepath/test_core_filepath.odin19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/core/path/filepath/test_core_filepath.odin b/tests/core/path/filepath/test_core_filepath.odin
index 9ca1b676f..61f87ad02 100644
--- a/tests/core/path/filepath/test_core_filepath.odin
+++ b/tests/core/path/filepath/test_core_filepath.odin
@@ -132,4 +132,23 @@ test_stem :: proc(t: ^testing.T) {
for d in short_stem {
testing.expect_value(t, filepath.short_stem(d[0]), d[1])
}
+}
+
+@(test)
+test_dir :: proc(t: ^testing.T) {
+ when ODIN_OS == .Windows {
+ @static dirs := [][2]string{
+ {"../bin/css", "..\\bin"},
+ {"W:/Odin/odin", "W:\\Odin"},
+ }
+ } else {
+ @static dirs := [][2]string{
+ {"../bin/css", "../bin"},
+ {"/bin/usr/", "/bin/usr"},
+ }
+ }
+
+ for d in dirs {
+ testing.expect_value(t, filepath.dir(d[0], context.temp_allocator), d[1])
+ }
} \ No newline at end of file