(t *testing.T)
| 11 | } |
| 12 | |
| 13 | func TestStopAndDrainTimer_UnfiredTimer(t *testing.T) { |
| 14 | timer := time.NewTimer(time.Hour) |
| 15 | StopAndDrainTimer(timer) |
| 16 | |
| 17 | // Channel should be empty after stop+drain. |
| 18 | select { |
| 19 | case <-timer.C: |
| 20 | t.Fatal("expected timer channel to be drained") |
| 21 | default: |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | func TestStopAndDrainTimer_FiredTimer(t *testing.T) { |
| 26 | timer := time.NewTimer(time.Nanosecond) |
nothing calls this directly
no test coverage detected