(t *testing.T)
| 151 | } |
| 152 | |
| 153 | func TestReLocateComment_LLMError(t *testing.T) { |
| 154 | cm := model.LlmComment{ |
| 155 | Path: "main.go", |
| 156 | Content: "test", |
| 157 | ExistingCode: "bad code", |
| 158 | } |
| 159 | d := makeDiff() |
| 160 | |
| 161 | client := &mockLLMClient{err: errors.New("network error")} |
| 162 | |
| 163 | ok, resp, msgs := ReLocateComment(context.Background(), &cm, d, client, makeTask(), "test-model", 1000) |
| 164 | if ok { |
| 165 | t.Fatal("expected false on LLM error") |
| 166 | } |
| 167 | if resp != nil { |
| 168 | t.Fatal("expected nil response on error") |
| 169 | } |
| 170 | if len(msgs) == 0 { |
| 171 | t.Fatal("expected non-empty messages even on error") |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | func TestReLocateComment_NilTask(t *testing.T) { |
| 176 | cm := model.LlmComment{ |
nothing calls this directly
no test coverage detected