MCPcopy Create free account
hub / github.com/JordanCoin/codemap / TestWaitForDaemonState

Function TestWaitForDaemonState

cmd/hooks_more_test.go:176–198  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

174}
175
176func TestWaitForDaemonState(t *testing.T) {
177 root := t.TempDir()
178 done := make(chan struct{})
179 go func() {
180 defer close(done)
181 time.Sleep(150 * time.Millisecond)
182 _ = os.MkdirAll(filepath.Join(root, ".codemap"), 0o755)
183 data, _ := json.Marshal(watch.State{
184 UpdatedAt: time.Now(),
185 FileCount: 7,
186 })
187 _ = os.WriteFile(filepath.Join(root, ".codemap", "state.json"), data, 0o644)
188 }()
189
190 state := waitForDaemonState(root, time.Second)
191 <-done
192 if state == nil {
193 t.Fatal("expected state before timeout")
194 }
195 if state.FileCount != 7 {
196 t.Fatalf("expected file count 7, got %d", state.FileCount)
197 }
198}
199
200func TestGetRecentHandoffAndBranchDetection(t *testing.T) {
201 if _, err := exec.LookPath("git"); err != nil {

Callers

nothing calls this directly

Calls 1

waitForDaemonStateFunction · 0.85

Tested by

no test coverage detected