(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestResetTimer(t *testing.T) { |
| 41 | timer := time.NewTimer(time.Hour) |
| 42 | |
| 43 | // Reset to a very short duration. |
| 44 | ResetTimer(timer, time.Nanosecond) |
| 45 | |
| 46 | select { |
| 47 | case <-timer.C: |
| 48 | // Expected. |
| 49 | case <-time.After(100 * time.Millisecond): |
| 50 | t.Fatal("expected timer to fire after reset") |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func TestResetTimer_AfterFired(t *testing.T) { |
| 55 | timer := time.NewTimer(time.Nanosecond) |
nothing calls this directly
no test coverage detected