MCPcopy Index your code
hub / github.com/desertbit/timer / TestNullTimout

Function TestNullTimout

timer_test.go:9–17  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestNullTimout(t *testing.T) {
10 // Timeout for 0 seconds.
11 start := time.Now()
12 timer := NewTimer(0)
13 <-timer.C
14 if int(time.Since(start).Seconds()) != 0 {
15 t.Errorf("took ~%v seconds, should be ~0 seconds\n", int(time.Since(start).Seconds()))
16 }
17}
18
19func TestNegativeTimout(t *testing.T) {
20 // Timeout for -1 seconds.

Callers

nothing calls this directly

Calls 1

NewTimerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…