(t *testing.T)
| 173 | } |
| 174 | |
| 175 | func TestNewDirectoriesAreRecursivelyWatched(t *testing.T) { |
| 176 | f := newNotifyFixture(t) |
| 177 | |
| 178 | root := f.TempDir("root") |
| 179 | |
| 180 | // watch parent |
| 181 | f.watch(root) |
| 182 | f.fsync() |
| 183 | f.events = nil |
| 184 | |
| 185 | // add a sub directory |
| 186 | subPath := filepath.Join(root, "sub") |
| 187 | f.MkdirAll(subPath) |
| 188 | |
| 189 | // change something inside sub directory |
| 190 | changeFilePath := filepath.Join(subPath, "change") |
| 191 | file, err := os.OpenFile(changeFilePath, os.O_RDONLY|os.O_CREATE, 0o666) |
| 192 | if err != nil { |
| 193 | t.Fatal(err) |
| 194 | } |
| 195 | _ = file.Close() |
| 196 | f.assertEvents(subPath, changeFilePath) |
| 197 | } |
| 198 | |
| 199 | func TestWatchNonExistentPath(t *testing.T) { |
| 200 | f := newNotifyFixture(t) |
nothing calls this directly
no test coverage detected