(t *testing.T)
| 176 | } |
| 177 | |
| 178 | func TestCodeReviewResult_JSON(t *testing.T) { |
| 179 | r := CodeReviewResult{ |
| 180 | RelevantFile: "api.go", |
| 181 | SuggestionContent: "suggestion", |
| 182 | ExistingCode: "old", |
| 183 | SuggestionCode: "new", |
| 184 | } |
| 185 | |
| 186 | data, err := json.Marshal(r) |
| 187 | if err != nil { |
| 188 | t.Fatalf("marshal: %v", err) |
| 189 | } |
| 190 | |
| 191 | var got CodeReviewResult |
| 192 | if err := json.Unmarshal(data, &got); err != nil { |
| 193 | t.Fatalf("unmarshal: %v", err) |
| 194 | } |
| 195 | |
| 196 | if got != r { |
| 197 | t.Errorf("roundtrip mismatch:\n got %+v\n want %+v", got, r) |
| 198 | } |
| 199 | } |
nothing calls this directly
no outgoing calls
no test coverage detected