MCPcopy Index your code
hub / github.com/tailscale/tailscale / TestZeroInitClock

Function TestZeroInitClock

tstest/clock_test.go:144–162  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

142}
143
144func TestZeroInitClock(t *testing.T) {
145 t.Parallel()
146
147 var clock Clock
148 start := clock.GetStart()
149
150 if step := clock.GetStep(); step != 0 {
151 t.Errorf("clock has step %v, want 0", step)
152 }
153
154 for i := range 10 {
155 if got := clock.Now(); !got.Equal(start) {
156 t.Errorf("step %v: clock.Now() = %v, want %v", i, got, start)
157 }
158 if got := clock.PeekNow(); !got.Equal(start) {
159 t.Errorf("step %v: clock.PeekNow() = %v, want %v", i, got, start)
160 }
161 }
162}
163
164func TestClockSetStep(t *testing.T) {
165 t.Parallel()

Callers

nothing calls this directly

Calls 6

GetStartMethod · 0.95
GetStepMethod · 0.95
NowMethod · 0.95
PeekNowMethod · 0.95
ErrorfMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…