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

Function TestCodeReviewResult_JSON

internal/model/model_test.go:178–199  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

176}
177
178func 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected