(t *testing.T)
| 415 | } |
| 416 | |
| 417 | func TestWatchNonexistentDirectory(t *testing.T) { |
| 418 | f := newNotifyFixture(t) |
| 419 | |
| 420 | root := f.JoinPath("root") |
| 421 | err := os.Mkdir(root, 0o777) |
| 422 | if err != nil { |
| 423 | t.Fatal(err) |
| 424 | } |
| 425 | parent := f.JoinPath("parent") |
| 426 | file := f.JoinPath("parent", "a") |
| 427 | |
| 428 | f.watch(parent) |
| 429 | f.fsync() |
| 430 | f.events = nil |
| 431 | |
| 432 | err = os.Mkdir(parent, 0o777) |
| 433 | if err != nil { |
| 434 | t.Fatal(err) |
| 435 | } |
| 436 | |
| 437 | // for directories that were the root of an Add, we don't report creation, cf. watcher_darwin.go |
| 438 | f.assertEvents() |
| 439 | |
| 440 | f.events = nil |
| 441 | f.WriteFile(file, "hello") |
| 442 | |
| 443 | f.assertEvents(file) |
| 444 | } |
| 445 | |
| 446 | func TestWatchNonexistentFileInNonexistentDirectory(t *testing.T) { |
| 447 | f := newNotifyFixture(t) |
nothing calls this directly
no test coverage detected