Add missing watch event for files
If a file was supposed to exist in a directory, and it didn't exist yet, when it gets created, we should notice, and cause an event so that we wake up and actually see about then creating that file!
This commit is contained in:
36
misc_test.go
36
misc_test.go
@@ -82,6 +82,41 @@ func TestMiscT3(t *testing.T) {
|
||||
|
||||
func TestMiscT4(t *testing.T) {
|
||||
|
||||
if PathPrefixDelta("/foo/bar/baz", "/foo/ba") != -1 {
|
||||
t.Errorf("Result should be -1.")
|
||||
}
|
||||
|
||||
if PathPrefixDelta("/foo/bar/baz", "/foo/bar") != 1 {
|
||||
t.Errorf("Result should be 1.")
|
||||
}
|
||||
|
||||
if PathPrefixDelta("/foo/bar/baz", "/foo/bar/") != 1 {
|
||||
t.Errorf("Result should be 1.")
|
||||
}
|
||||
|
||||
if PathPrefixDelta("/foo/bar/baz/", "/foo/bar") != 1 {
|
||||
t.Errorf("Result should be 1.")
|
||||
}
|
||||
|
||||
if PathPrefixDelta("/foo/bar/baz/", "/foo/bar/") != 1 {
|
||||
t.Errorf("Result should be 1.")
|
||||
}
|
||||
|
||||
if PathPrefixDelta("/foo/bar/baz/", "/foo/bar/baz/dude") != -1 {
|
||||
t.Errorf("Result should be -1.")
|
||||
}
|
||||
|
||||
if PathPrefixDelta("/foo/bar/baz/a/b/c/", "/foo/bar/baz") != 3 {
|
||||
t.Errorf("Result should be 3.")
|
||||
}
|
||||
|
||||
if PathPrefixDelta("/foo/bar/baz/", "/foo/bar/baz") != 0 {
|
||||
t.Errorf("Result should be 0.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestMiscT5(t *testing.T) {
|
||||
|
||||
if PathIsDir("/foo/bar/baz/") != true {
|
||||
t.Errorf("Result should be false.")
|
||||
}
|
||||
@@ -97,5 +132,4 @@ func TestMiscT4(t *testing.T) {
|
||||
if PathIsDir("/") != true {
|
||||
t.Errorf("Result should be true.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user