This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user