(t *testing.T)
| 17 | } |
| 18 | |
| 19 | func TestNegativeTimout(t *testing.T) { |
| 20 | // Timeout for -1 seconds. |
| 21 | start := time.Now() |
| 22 | timer := NewTimer(-1) |
| 23 | <-timer.C |
| 24 | if int(time.Since(start).Seconds()) != 0 { |
| 25 | t.Errorf("took ~%v seconds, should be ~0 seconds\n", int(time.Since(start).Seconds())) |
| 26 | } |
| 27 | |
| 28 | // Timeout for -100 seconds. |
| 29 | start = time.Now() |
| 30 | timer = NewTimer(-100 * time.Second) |
| 31 | <-timer.C |
| 32 | if int(time.Since(start).Seconds()) != 0 { |
| 33 | t.Errorf("took ~%v seconds, should be ~0 seconds\n", int(time.Since(start).Seconds())) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func TestTimeValue(t *testing.T) { |
| 38 | // Timeout for 0 seconds. |
nothing calls this directly
no test coverage detected
searching dependent graphs…