(t *testing.T)
| 361 | } |
| 362 | |
| 363 | func 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 | |
| 382 | func TestWatchBothDirAndFile(t *testing.T) { |
| 383 | f := newNotifyFixture(t) |
nothing calls this directly
no test coverage detected