(t *testing.T)
| 64 | } |
| 65 | |
| 66 | func TestJobPanicRecovery(t *testing.T) { |
| 67 | var job DummyJob |
| 68 | |
| 69 | var buf syncWriter |
| 70 | cron := New(WithParser(secondParser), |
| 71 | WithChain(Recover(newBufLogger(&buf)))) |
| 72 | cron.Start() |
| 73 | defer cron.Stop() |
| 74 | cron.AddJob("* * * * * ?", job) |
| 75 | |
| 76 | select { |
| 77 | case <-time.After(OneSecond): |
| 78 | if !strings.Contains(buf.String(), "YOLO") { |
| 79 | t.Error("expected a panic to be logged, got none") |
| 80 | } |
| 81 | return |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | // Start and stop cron with no entries. |
| 86 | func TestNoEntries(t *testing.T) { |
nothing calls this directly
no test coverage detected