MCPcopy Create free account
hub / github.com/driangle/taskmd / TestWatcher_Stop

Function TestWatcher_Stop

apps/cli/internal/watcher/watcher_test.go:110–129  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

108}
109
110func TestWatcher_Stop(t *testing.T) {
111 dir := t.TempDir()
112
113 w := New(dir, func() {}, 50*time.Millisecond)
114
115 done := make(chan error, 1)
116 go func() {
117 done <- w.Start()
118 }()
119
120 time.Sleep(50 * time.Millisecond)
121 w.Stop()
122
123 select {
124 case <-done:
125 // OK - stopped successfully
126 case <-time.After(time.Second):
127 t.Fatal("watcher did not stop within timeout")
128 }
129}

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
StopMethod · 0.80
StartMethod · 0.45

Tested by

no test coverage detected