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

Function TestReLocateComment_NilTask

internal/diff/relocation_test.go:175–194  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

173}
174
175func TestReLocateComment_NilTask(t *testing.T) {
176 cm := model.LlmComment{
177 Path: "main.go",
178 Content: "test",
179 ExistingCode: "bad code",
180 }
181 d := makeDiff()
182 client := &mockLLMClient{}
183
184 ok, resp, msgs := ReLocateComment(context.Background(), &cm, d, client, nil, "test-model", 1000)
185 if ok {
186 t.Fatal("expected false when task is nil")
187 }
188 if resp != nil {
189 t.Fatal("expected nil response when task is nil")
190 }
191 if msgs != nil {
192 t.Fatal("expected nil messages when task is nil")
193 }
194}
195
196func TestExtractCodeBlock(t *testing.T) {
197 tests := []struct {

Callers

nothing calls this directly

Calls 2

makeDiffFunction · 0.85
ReLocateCommentFunction · 0.85

Tested by

no test coverage detected