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

Function TestRemove

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

Source from the content-addressed store, hash-verified

226}
227
228func TestRemove(t *testing.T) {
229 f := newNotifyFixture(t)
230
231 root := f.TempDir("root")
232 path := filepath.Join(root, "change")
233
234 d1 := "hello\ngo\n"
235 f.WriteFile(path, d1)
236
237 f.watch(path)
238 f.fsync()
239 f.events = nil
240 err := os.Remove(path)
241 if err != nil {
242 t.Fatal(err)
243 }
244 f.assertEvents(path)
245}
246
247func TestRemoveAndAddBack(t *testing.T) {
248 f := newNotifyFixture(t)

Callers

nothing calls this directly

Calls 7

newNotifyFixtureFunction · 0.85
TempDirMethod · 0.80
WriteFileMethod · 0.80
fsyncMethod · 0.80
assertEventsMethod · 0.80
RemoveMethod · 0.65
watchMethod · 0.45

Tested by

no test coverage detected