(t *testing.T)
| 331 | } |
| 332 | |
| 333 | func TestWatchBrokenLink(t *testing.T) { |
| 334 | if runtime.GOOS == "windows" { |
| 335 | t.Skip("no user-space symlinks on windows") |
| 336 | } |
| 337 | f := newNotifyFixture(t) |
| 338 | |
| 339 | newRoot, err := NewDir(t.Name()) |
| 340 | if err != nil { |
| 341 | t.Fatal(err) |
| 342 | } |
| 343 | defer func() { |
| 344 | err := newRoot.TearDown() |
| 345 | if err != nil { |
| 346 | fmt.Printf("error tearing down temp dir: %v\n", err) |
| 347 | } |
| 348 | }() |
| 349 | |
| 350 | link := filepath.Join(newRoot.Path(), "brokenLink") |
| 351 | missingFile := filepath.Join(newRoot.Path(), "missingFile") |
| 352 | err = os.Symlink(missingFile, link) |
| 353 | if err != nil { |
| 354 | t.Fatal(err) |
| 355 | } |
| 356 | |
| 357 | f.watch(newRoot.Path()) |
| 358 | err = os.Remove(link) |
| 359 | assert.NilError(t, err) |
| 360 | f.assertEvents(link) |
| 361 | } |
| 362 | |
| 363 | func TestMoveAndReplace(t *testing.T) { |
| 364 | f := newNotifyFixture(t) |
nothing calls this directly
no test coverage detected