MCPcopy
hub / github.com/docker/compose / TestWatchNonexistentFileInNonexistentDirectory

Function TestWatchNonexistentFileInNonexistentDirectory

pkg/watch/notify_test.go:446–468  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

444}
445
446func TestWatchNonexistentFileInNonexistentDirectory(t *testing.T) {
447 f := newNotifyFixture(t)
448
449 root := f.JoinPath("root")
450 err := os.Mkdir(root, 0o777)
451 if err != nil {
452 t.Fatal(err)
453 }
454 parent := f.JoinPath("parent")
455 file := f.JoinPath("parent", "a")
456
457 f.watch(file)
458 f.assertEvents()
459
460 err = os.Mkdir(parent, 0o777)
461 if err != nil {
462 t.Fatal(err)
463 }
464
465 f.assertEvents()
466 f.WriteFile(file, "hello")
467 f.assertEvents(file)
468}
469
470func TestWatchCountInnerFile(t *testing.T) {
471 f := newNotifyFixture(t)

Callers

nothing calls this directly

Calls 5

newNotifyFixtureFunction · 0.85
JoinPathMethod · 0.80
assertEventsMethod · 0.80
WriteFileMethod · 0.80
watchMethod · 0.45

Tested by

no test coverage detected