diff --git a/internal/fswatcher/inotify/inotify_test.go b/internal/fswatcher/inotify/inotify_test.go index 7b36006..2a21fad 100644 --- a/internal/fswatcher/inotify/inotify_test.go +++ b/internal/fswatcher/inotify/inotify_test.go @@ -1,6 +1,7 @@ package inotify import ( + "fmt" "io/ioutil" "os" "testing" @@ -17,6 +18,11 @@ func TestInotify(t *testing.T) { err = i.Watch("testdata/folder") expectNoError(t, err) + err = i.Watch("testdata/non-existing-folder") + if fmt.Sprintf("%v", err) != "adding watch to testdata/non-existing-folder: errno: 2" { + t.Errorf("Wrong error for non-existing-folder: got %v", err) + } + err = ioutil.WriteFile("testdata/folder/f1", []byte("file content"), 0644) expectNoError(t, err) defer os.Remove("testdata/folder/f1")