File tree Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package tests_core_os_os2
33import os " core:os/os2"
44import " core:log"
55import " core:testing"
6+ import " core:slice"
67import " core:strings"
78
89@(test)
@@ -376,10 +377,33 @@ test_split_path_list :: proc(t: ^testing.T) {
376377 }
377378}
378379
379- @(test)
380- test_glob :: proc (t: ^testing.T) {
381-
380+ Glob_Test :: struct {
381+ pattern: string ,
382+ matches: []string ,
383+ err: os.Error,
384+ }
382385
386+ glob_tests := []Glob_Test{
387+ {
388+ pattern = ODIN_ROOT + " tests/core/os/*/*.txt" ,
389+ matches = {},
390+ err = nil ,
391+ },
392+ }
383393
394+ @(test)
395+ test_glob :: proc (t: ^testing.T) {
396+ for glob in glob_tests {
397+ files, err := os.glob (glob.pattern, context .allocator)
398+ defer {
399+ for file in files {
400+ delete (file)
401+ }
402+ delete (files)
403+ }
404+ testing.expect_value (t, err, glob.err)
384405
406+ slice.sort (files)
407+ log.infof (" files: %v" , files)
408+ }
385409}
You can’t perform that action at this time.
0 commit comments