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

Function TestWatchesAreRecursive

pkg/watch/notify_test.go:154–173  ·  pkg/watch/notify_test.go::TestWatchesAreRecursive
(t *testing.T)

Source from the content-addressed store, hash-verified

152}
153
154func TestWatchesAreRecursive(t *testing.T) {
155 f := newNotifyFixture(t)
156
157 root := f.TempDir("root")
158
159 // add a sub directory
160 subPath := filepath.Join(root, "sub")
161 f.MkdirAll(subPath)
162
163 // watch parent
164 f.watch(root)
165
166 f.fsync()
167 f.events = nil
168 // change sub directory
169 changeFilePath := filepath.Join(subPath, "change")
170 f.WriteFile(changeFilePath, "change")
171
172 f.assertEvents(changeFilePath)
173}
174
175func TestNewDirectoriesAreRecursivelyWatched(t *testing.T) {
176 f := newNotifyFixture(t)

Callers

nothing calls this directly

Calls 7

newNotifyFixtureFunction · 0.85
TempDirMethod · 0.80
MkdirAllMethod · 0.80
fsyncMethod · 0.80
WriteFileMethod · 0.80
assertEventsMethod · 0.80
watchMethod · 0.45

Tested by

no test coverage detected