(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestParseAgentLogNoEngine(t *testing.T) { |
| 39 | // Create a temporary directory with agent-stdio.log |
| 40 | tempDir := testutil.TempDir(t, "test-*") |
| 41 | |
| 42 | agentStdioPath := filepath.Join(tempDir, "agent-stdio.log") |
| 43 | if err := os.WriteFile(agentStdioPath, []byte("[]"), 0644); err != nil { |
| 44 | t.Fatalf("Failed to create mock agent-stdio.log: %v", err) |
| 45 | } |
| 46 | |
| 47 | // Run the parser with nil engine - should skip gracefully |
| 48 | err := parseAgentLog(tempDir, nil, true) |
| 49 | if err != nil { |
| 50 | t.Fatalf("parseAgentLog should not fail with nil engine: %v", err) |
| 51 | } |
| 52 | |
| 53 | // Check that log.md was NOT created |
| 54 | logMdPath := filepath.Join(tempDir, "log.md") |
| 55 | if _, err := os.Stat(logMdPath); !os.IsNotExist(err) { |
| 56 | t.Fatalf("log.md should not be created when engine is nil") |
| 57 | } |
| 58 | } |
nothing calls this directly
no test coverage detected