1 // Copyright (c) 2014-2015 The Notify Authors. All rights reserved.
2 // Use of this source code is governed by the MIT license that can be
3 // found in the LICENSE file.
11 func TestNotifySystemSpecificEvent(t *testing.T) {
12 n := NewNotifyTest(t, "testdata/vfs.txt")
17 n.Watch("src/github.com/rjeczalik/fs", ch[0], FileNotifyChangeFileName, FileNotifyChangeSize)
21 Event: rremove(n.W(), "src/github.com/rjeczalik/fs/fs.go"),
22 Receiver: Chans{ch[0]},
25 Event: rwrite(n.W(), "src/github.com/rjeczalik/fs/README.md", []byte("XD")),
26 Receiver: Chans{ch[0]},
30 n.ExpectNotifyEvents(cases, ch)
33 func TestUnknownEvent(t *testing.T) {
34 n := NewNotifyTest(t, "testdata/vfs.txt")
39 n.WatchErr("src/github.com/rjeczalik/fs", ch[0], nil, FileActionAdded)
42 func TestNotifySystemAndGlobalMix(t *testing.T) {
43 n := NewNotifyTest(t, "testdata/vfs.txt")
48 n.Watch("src/github.com/rjeczalik/fs", ch[0], Create)
49 n.Watch("src/github.com/rjeczalik/fs", ch[1], FileNotifyChangeFileName)
50 n.Watch("src/github.com/rjeczalik/fs", ch[2], FileNotifyChangeDirName)
54 Event: rcreate(n.W(), "src/github.com/rjeczalik/fs/.main.cc.swr"),
55 Receiver: Chans{ch[0], ch[1]},
59 n.ExpectNotifyEvents(cases, ch)