fakeWatcher implements the watcher.Watcher interface for testing. It allows controlling what events are sent and when.
| 231 | // fakeWatcher implements the watcher.Watcher interface for testing. |
| 232 | // It allows controlling what events are sent and when. |
| 233 | type fakeWatcher struct { |
| 234 | t testing.TB |
| 235 | events chan *fsnotify.Event |
| 236 | closeNotify chan struct{} |
| 237 | addedPaths []string |
| 238 | closed bool |
| 239 | nextCalled chan struct{} |
| 240 | nextErr error |
| 241 | closeErr error |
| 242 | } |
| 243 | |
| 244 | func newFakeWatcher(t testing.TB) *fakeWatcher { |
| 245 | return &fakeWatcher{ |
nothing calls this directly
no outgoing calls
no test coverage detected