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

Function TestSingleFile

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

Source from the content-addressed store, hash-verified

274}
275
276func TestSingleFile(t *testing.T) {
277 f := newNotifyFixture(t)
278
279 root := f.TempDir("root")
280 path := filepath.Join(root, "change")
281
282 d1 := "hello\ngo\n"
283 f.WriteFile(path, d1)
284
285 f.watch(path)
286 f.fsync()
287
288 d2 := []byte("hello\nworld\n")
289 err := os.WriteFile(path, d2, 0o644)
290 if err != nil {
291 t.Fatal(err)
292 }
293 f.assertEvents(path)
294}
295
296func TestWriteBrokenLink(t *testing.T) {
297 if runtime.GOOS == "windows" {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected