(t *testing.T)
| 23 | } |
| 24 | |
| 25 | func TestStopAndDrainTimer_FiredTimer(t *testing.T) { |
| 26 | timer := time.NewTimer(time.Nanosecond) |
| 27 | // Wait for it to fire. |
| 28 | time.Sleep(time.Millisecond) |
| 29 | |
| 30 | StopAndDrainTimer(timer) |
| 31 | |
| 32 | // Channel should be empty after stop+drain. |
| 33 | select { |
| 34 | case <-timer.C: |
| 35 | t.Fatal("expected timer channel to be drained") |
| 36 | default: |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | func TestResetTimer(t *testing.T) { |
| 41 | timer := time.NewTimer(time.Hour) |
nothing calls this directly
no test coverage detected