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

Function TestTimeValue

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

Source from the content-addressed store, hash-verified

35}
36
37func TestTimeValue(t *testing.T) {
38 // Timeout for 0 seconds.
39 start := time.Now()
40 timer := NewTimer(time.Second)
41 v := <-timer.C
42 if diff := v.Sub(start).Seconds(); int(diff) != 1 {
43 t.Errorf("invalid time value: %v", int(diff))
44 }
45}
46
47func TestSingleTimout(t *testing.T) {
48 // Timeout for 1 second and wait.

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…