(expected ...string)
| 538 | } |
| 539 | |
| 540 | func (f *notifyFixture) assertEvents(expected ...string) { |
| 541 | f.fsync() |
| 542 | if runtime.GOOS == "windows" { |
| 543 | // NOTE(nick): It's unclear to me why an extra fsync() helps |
| 544 | // here, but it makes the I/O way more predictable. |
| 545 | f.fsync() |
| 546 | } |
| 547 | |
| 548 | if len(f.events) != len(expected) { |
| 549 | f.T().Fatalf("Got %d events (expected %d): %v %v", len(f.events), len(expected), f.events, expected) |
| 550 | } |
| 551 | |
| 552 | for i, actual := range f.events { |
| 553 | e := FileEvent(expected[i]) |
| 554 | if actual != e { |
| 555 | f.T().Fatalf("Got event %v (expected %v)", actual, e) |
| 556 | } |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | func (f *notifyFixture) consumeEventsInBackground(ctx context.Context) chan error { |
| 561 | done := make(chan error) |
no test coverage detected