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

Function TestMoveAndReplace

pkg/watch/notify_test.go:363–380  ·  pkg/watch/notify_test.go::TestMoveAndReplace
(t *testing.T)

Source from the content-addressed store, hash-verified

361}
362
363func TestMoveAndReplace(t *testing.T) {
364 f := newNotifyFixture(t)
365
366 root := f.TempDir("root")
367 file := filepath.Join(root, "myfile")
368 f.WriteFile(file, "hello")
369
370 f.watch(file)
371 tmpFile := filepath.Join(root, ".myfile.swp")
372 f.WriteFile(tmpFile, "world")
373
374 err := os.Rename(tmpFile, file)
375 if err != nil {
376 t.Fatal(err)
377 }
378
379 f.assertEvents(file)
380}
381
382func TestWatchBothDirAndFile(t *testing.T) {
383 f := newNotifyFixture(t)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected