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

Function TestWatchBothDirAndFile

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

Source from the content-addressed store, hash-verified

380}
381
382func TestWatchBothDirAndFile(t *testing.T) {
383 f := newNotifyFixture(t)
384
385 dir := f.JoinPath("foo")
386 fileA := f.JoinPath("foo", "a")
387 fileB := f.JoinPath("foo", "b")
388 f.WriteFile(fileA, "a")
389 f.WriteFile(fileB, "b")
390
391 f.watch(fileA)
392 f.watch(dir)
393 f.fsync()
394 f.events = nil
395
396 f.WriteFile(fileB, "b-new")
397 f.assertEvents(fileB)
398}
399
400func TestWatchNonexistentFileInNonexistentDirectoryCreatedSimultaneously(t *testing.T) {
401 f := newNotifyFixture(t)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected