Add a test-case for issue #16

This commit is contained in:
Rafal Jeczalik
2014-09-19 20:55:53 +02:00
parent c3bbc7a09e
commit f33bc764ef
4 changed files with 17 additions and 1 deletions
+1
View File
@@ -11,6 +11,7 @@ import (
const usage = "usage: notify path [EVENT...]"
var event = map[string]notify.Event{
"all": notify.All,
"create": notify.Create,
"delete": notify.Delete,
"write": notify.Write,
+1
View File
@@ -3,4 +3,5 @@ package notify
import "testing"
func TestDispatch(t *testing.T) {
t.Skip("TODO(rjeczalik)")
}
+4
View File
@@ -82,6 +82,10 @@ func TestJoinevents(t *testing.T) {
}
}
func TestSplitevents(t *testing.T) {
t.Skip("TODO(rjeczalik)")
}
func TestWalkpath(t *testing.T) {
cases := map[string]struct {
p []string
+11 -1
View File
@@ -91,7 +91,17 @@ func TestGlobalWatcher(t *testing.T) {
Ev("github.com/rjeczalik/fs/virfs", Delete, false),
// BUG(OS X): The same as above, this time "bad file descriptor" on a file
// that was created previously.
Ev("github.com/rjeczalik/fs/LICENSE", Write, false),
// Ev("github.com/rjeczalik/fs/LICENSE", Write, false),
// TODO(rjeczalik): For non-recursive watchers directory delete results
// in lots of delete events of the subtree. Is it possible to "squash"
// them into one event? How it should work cross-platform?
// Ev("github.com", Delete, true),
Ev("file", Create, false),
Ev("dir", Create, true),
}
test(t, global.Watcher, ei, time.Second)
}
func TestIssue16(t *testing.T) {
test(t, global.Watcher, []EventInfo{Ev("github.com", Delete, true)}, time.Second)
}