mirror of
https://github.com/syncthing/notify.git
synced 2026-06-07 08:57:32 +00:00
Add a test-case for issue #16
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -3,4 +3,5 @@ package notify
|
||||
import "testing"
|
||||
|
||||
func TestDispatch(t *testing.T) {
|
||||
t.Skip("TODO(rjeczalik)")
|
||||
}
|
||||
|
||||
@@ -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
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user