accept dir for http args
All checks were successful
cicd / cicd (push) Successful in 12s

This commit is contained in:
bel
2023-10-28 10:24:29 -06:00
parent 4b2af6b85e
commit 476c44f5cd
4 changed files with 45 additions and 6 deletions

View File

@@ -275,3 +275,18 @@ func TestFileDeltas(t *testing.T) {
})
}
}
func TestFilesOfDir(t *testing.T) {
d := t.TempDir()
files := Files([]string{d, "/dev/null"})
if paths := files.paths(); len(paths) != 1 {
t.Error(paths)
}
os.WriteFile(path.Join(d, "1"), []byte{}, os.ModePerm)
os.Mkdir(path.Join(d, "d2"), os.ModePerm)
os.WriteFile(path.Join(d, "d2", "2"), []byte{}, os.ModePerm)
if paths := files.paths(); len(paths) != 3 || paths[0] != path.Join(d, "1") || paths[1] != path.Join(d, "d2", "2") {
t.Error(paths)
}
}