(t *testing.T)
| 25 | ) |
| 26 | |
| 27 | func TestFseventNotifyCloseIdempotent(t *testing.T) { |
| 28 | // Create a watcher with a temporary directory |
| 29 | tmpDir := t.TempDir() |
| 30 | watcher, err := newWatcher([]string{tmpDir}) |
| 31 | assert.NilError(t, err) |
| 32 | |
| 33 | // Start the watcher |
| 34 | err = watcher.Start() |
| 35 | assert.NilError(t, err) |
| 36 | |
| 37 | // Close should work the first time |
| 38 | err = watcher.Close() |
| 39 | assert.NilError(t, err) |
| 40 | |
| 41 | // Close should be idempotent - calling it again should not panic |
| 42 | err = watcher.Close() |
| 43 | assert.NilError(t, err) |
| 44 | |
| 45 | // Even a third time should be safe |
| 46 | err = watcher.Close() |
| 47 | assert.NilError(t, err) |
| 48 | } |
nothing calls this directly
no test coverage detected