MCPcopy Index your code
hub / github.com/sourcegraph/checkup / TestCheckAndStoreEvery

Function TestCheckAndStoreEvery

checkup_test.go:69–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

67}
68
69func TestCheckAndStoreEvery(t *testing.T) {
70 f := new(fake)
71 c := Checkup{Storage: f, Checkers: []Checker{f}}
72
73 ticker := c.CheckAndStoreEvery(50 * time.Millisecond)
74 time.Sleep(170 * time.Millisecond)
75 ticker.Stop()
76
77 f.Lock()
78 defer f.Unlock()
79 if got, want := f.checked, 3; got != want {
80 t.Errorf("Expected %d checks while sleeping, had: %d", want, got)
81 }
82}
83
84func TestComputeStats(t *testing.T) {
85 s := types.Result{Times: []types.Attempt{

Callers

nothing calls this directly

Calls 1

CheckAndStoreEveryMethod · 0.95

Tested by

no test coverage detected