(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestMultipleDifferentTimouts(t *testing.T) { |
| 76 | start := time.Now() |
| 77 | var timers []*Timer |
| 78 | |
| 79 | for i := 0; i < 1000; i++ { |
| 80 | timers = append(timers, NewTimer(time.Duration(i%4)*time.Second)) |
| 81 | } |
| 82 | |
| 83 | // Wait for them all to expire. |
| 84 | for _, timer := range timers { |
| 85 | <-timer.C |
| 86 | } |
| 87 | |
| 88 | if int(time.Since(start).Seconds()) != 3 { |
| 89 | t.Errorf("took ~%v seconds, should be ~3 seconds\n", int(time.Since(start).Seconds())) |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | func TestStoppedTimer(t *testing.T) { |
| 94 | timer := NewStoppedTimer() |
nothing calls this directly
no test coverage detected
searching dependent graphs…