MCPcopy Create free account
hub / github.com/alibaba/open-code-review / TestRunPerFile_ContextCancelled

Function TestRunPerFile_ContextCancelled

internal/llmloop/loop_test.go:150–166  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

148}
149
150func 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
168func TestRunPerFile_UnknownTool(t *testing.T) {
169 content := ""

Callers

nothing calls this directly

Calls 5

RunPerFileMethod · 0.95
NewTextMessageFunction · 0.92
taskDoneResponseFunction · 0.85
newTestDepsFunction · 0.85
NewRunnerFunction · 0.85

Tested by

no test coverage detected