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