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

Function TestWriteGoodLink

pkg/watch/notify_test.go:312–331  ·  pkg/watch/notify_test.go::TestWriteGoodLink
(t *testing.T)

Source from the content-addressed store, hash-verified

310}
311
312func TestWriteGoodLink(t *testing.T) {
313 if runtime.GOOS == "windows" {
314 t.Skip("no user-space symlinks on windows")
315 }
316 f := newNotifyFixture(t)
317
318 goodFile := filepath.Join(f.paths[0], "goodFile")
319 err := os.WriteFile(goodFile, []byte("hello"), 0o644)
320 if err != nil {
321 t.Fatal(err)
322 }
323
324 link := filepath.Join(f.paths[0], "goodFileSymlink")
325 err = os.Symlink(goodFile, link)
326 if err != nil {
327 t.Fatal(err)
328 }
329
330 f.assertEvents(goodFile, link)
331}
332
333func TestWatchBrokenLink(t *testing.T) {
334 if runtime.GOOS == "windows" {

Callers

nothing calls this directly

Calls 3

newNotifyFixtureFunction · 0.85
WriteFileMethod · 0.80
assertEventsMethod · 0.80

Tested by

no test coverage detected