MCPcopy Index your code
hub / github.com/MiniCodeMonkey/chief / TestLoop_LogFile

Function TestLoop_LogFile

internal/loop/loop_test.go:307–332  ·  view source on GitHub ↗

TestLoop_LogFile tests that log file is created and written to.

(t *testing.T)

Source from the content-addressed store, hash-verified

305
306// TestLoop_LogFile tests that log file is created and written to.
307func TestLoop_LogFile(t *testing.T) {
308 tmpDir := t.TempDir()
309 _ = createTestPRD(t, tmpDir, true)
310
311 logPath := filepath.Join(tmpDir, "claude.log")
312 logFile, err := os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
313 if err != nil {
314 t.Fatalf("Failed to create log file: %v", err)
315 }
316
317 l := NewLoop(filepath.Join(tmpDir, "prd.md"), "test", 1, testProvider)
318 l.logFile = logFile
319
320 l.logLine("test log line")
321 logFile.Close()
322
323 // Read back the log file
324 data, err := os.ReadFile(logPath)
325 if err != nil {
326 t.Fatalf("Failed to read log file: %v", err)
327 }
328
329 if string(data) != "test log line\n" {
330 t.Errorf("Expected log line content, got %q", string(data))
331 }
332}
333
334// TestLoop_ChiefDoneEvent tests detection of <chief-done/> event.
335func TestLoop_ChiefDoneEvent(t *testing.T) {

Callers

nothing calls this directly

Calls 3

logLineMethod · 0.95
createTestPRDFunction · 0.85
NewLoopFunction · 0.85

Tested by

no test coverage detected