github.com/DiversionCompany/notify@v0.9.9/notify_inotify_test.go (about)

     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.
     4  
     5  //go:build linux
     6  // +build linux
     7  
     8  package notify
     9  
    10  import "testing"
    11  
    12  func TestNotifySystemAndGlobalMix(t *testing.T) {
    13  	n := NewNotifyTest(t, "testdata/vfs.txt")
    14  
    15  	ch := NewChans(2)
    16  
    17  	n.Watch("src/github.com/rjeczalik/fs", ch[0], Create)
    18  	n.Watch("src/github.com/rjeczalik/fs", ch[1], InCreate)
    19  
    20  	cases := []NCase{
    21  		{
    22  			Event:    icreate(n.W(), "src/github.com/rjeczalik/fs/.main.cc.swr"),
    23  			Receiver: Chans{ch[0], ch[1]},
    24  		},
    25  	}
    26  
    27  	n.ExpectNotifyEvents(cases, ch)
    28  }
    29  
    30  func TestUnknownEvent(t *testing.T) {
    31  	n := NewNotifyTest(t, "testdata/vfs.txt")
    32  
    33  	ch := NewChans(1)
    34  
    35  	n.WatchErr("src/github.com/rjeczalik/fs", ch[0], nil, inExclUnlink)
    36  }