(t *testing.T)
| 148 | } |
| 149 | |
| 150 | func TestRunPerFile_ContextCancelled(t *testing.T) { |
| 151 | client := &fakeClient{responses: []*llm.ChatResponse{taskDoneResponse()}} |
| 152 | deps := newTestDeps(client) |
| 153 | runner := NewRunner(deps) |
| 154 | |
| 155 | ctx, cancel := context.WithCancel(context.Background()) |
| 156 | cancel() |
| 157 | |
| 158 | msgs := []llm.Message{llm.NewTextMessage("user", "review")} |
| 159 | completed, err := runner.RunPerFile(ctx, msgs, "main.go") |
| 160 | if err == nil { |
| 161 | t.Error("expected error for cancelled context") |
| 162 | } |
| 163 | if completed { |
| 164 | t.Fatal("cancelled context should not complete RunPerFile") |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | func TestRunPerFile_UnknownTool(t *testing.T) { |
| 169 | content := "" |
nothing calls this directly
no test coverage detected