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