From 3e6eaa5ce7ae29b69a491d625eb34dac0d0661ce Mon Sep 17 00:00:00 2001 From: Dominic Breuker Date: Wed, 14 Mar 2018 09:12:45 +0100 Subject: [PATCH] extend inotify test --- internal/fswatcher/inotify/inotify_test.go | 6 ++++++ 1 file changed, 6 insertions(+) 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")