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

Function TestWatchCountInnerFile

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

Source from the content-addressed store, hash-verified

468}
469
470func TestWatchCountInnerFile(t *testing.T) {
471 f := newNotifyFixture(t)
472
473 root := f.paths[0]
474 a := f.JoinPath(root, "a")
475 b := f.JoinPath(a, "b")
476 file := f.JoinPath(b, "bigFile")
477 f.WriteFile(file, "hello")
478 f.assertEvents(a, b, file)
479
480 expectedWatches := 3
481 if isRecursiveWatcher() {
482 expectedWatches = 1
483 }
484 assert.Equal(t, expectedWatches, int(numberOfWatches.Value()))
485}
486
487func isRecursiveWatcher() bool {
488 return runtime.GOOS == "darwin" || runtime.GOOS == "windows"

Callers

nothing calls this directly

Calls 5

newNotifyFixtureFunction · 0.85
isRecursiveWatcherFunction · 0.85
JoinPathMethod · 0.80
WriteFileMethod · 0.80
assertEventsMethod · 0.80

Tested by

no test coverage detected