file: Overhaul file resource and add recursion
The file resource contained some of the early golang code that I wrote for this project. Needless to say, some of it was quite yucky, and it was also lacking a number of important features. This patch builds upon it so that it starts being usable for directories of files too. Many thanks to Sam Gélineau for helping with the recursive watching. My brain officially didn't want to look at that code anymore.
This commit is contained in:
19
misc_test.go
19
misc_test.go
@@ -152,25 +152,6 @@ func TestMiscT4(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMiscT5(t *testing.T) {
|
||||
|
||||
if PathIsDir("/foo/bar/baz/") != true {
|
||||
t.Errorf("Result should be false.")
|
||||
}
|
||||
|
||||
if PathIsDir("/foo/bar/baz") != false {
|
||||
t.Errorf("Result should be false.")
|
||||
}
|
||||
|
||||
if PathIsDir("/foo/") != true {
|
||||
t.Errorf("Result should be true.")
|
||||
}
|
||||
|
||||
if PathIsDir("/") != true {
|
||||
t.Errorf("Result should be true.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestMiscT8(t *testing.T) {
|
||||
|
||||
r0 := []string{"/"}
|
||||
|
||||
Reference in New Issue
Block a user