aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2025-11-01 11:24:39 +0100
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2026-02-08 12:54:24 +0100
commit5d03da8365bd17715a29e497398633fcefcbd8c7 (patch)
tree7bee009e81b4ff2f50b08d753b1488ad3c7ce2bf /tests
parent1c9e36b05ee5d0ad0fd867d71ccc6863ebc90e79 (diff)
Start of glob test
Diffstat (limited to 'tests')
-rw-r--r--tests/core/os/os2/path.odin30
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/core/os/os2/path.odin b/tests/core/os/os2/path.odin
index 1a470396b..26cf1c290 100644
--- a/tests/core/os/os2/path.odin
+++ b/tests/core/os/os2/path.odin
@@ -3,6 +3,7 @@ package tests_core_os_os2
import os "core:os/os2"
import "core:log"
import "core:testing"
+import "core:slice"
import "core:strings"
@(test)
@@ -376,10 +377,33 @@ test_split_path_list :: proc(t: ^testing.T) {
}
}
-@(test)
-test_glob :: proc(t: ^testing.T) {
-
+Glob_Test :: struct {
+ pattern: string,
+ matches: []string,
+ err: os.Error,
+}
+glob_tests := []Glob_Test{
+ {
+ pattern = ODIN_ROOT + "tests/core/os/*/*.txt",
+ matches = {},
+ err = nil,
+ },
+}
+@(test)
+test_glob :: proc(t: ^testing.T) {
+ for glob in glob_tests {
+ files, err := os.glob(glob.pattern, context.allocator)
+ defer {
+ for file in files {
+ delete(file)
+ }
+ delete(files)
+ }
+ testing.expect_value(t, err, glob.err)
+ slice.sort(files)
+ log.infof("files: %v", files)
+ }
} \ No newline at end of file