Skip to content

Commit b2717a0

Browse files
test(repos): distinguish legacy and modern commit text
Keep exact-main byte assertions for the legacy protocol and verify modern text represents the same typed DTO as structured content. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent aa9b297 commit b2717a0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎pkg/github/typed_repository_commit_outputs_test.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,17 @@ func TestTypedRepositoryCommitOutputs(t *testing.T) {
183183
require.False(t, result.IsError, "%s: %s", call.name, result)
184184
require.Len(t, result.Content, 1, "%s must preserve one legacy text result", call.name)
185185
assert.NotNil(t, result.Meta["ifc"], "typed and legacy outputs retain IFC labeling")
186-
assert.Equal(t, call.text, getTextResult(t, result).Text, "%s legacy text is byte-exact", call.name)
186+
text := getTextResult(t, result).Text
187187
if protocolVersion == "2025-11-25" {
188+
assert.Equal(t, call.text, text, "%s legacy text is byte-exact", call.name)
188189
assert.Nil(t, result.StructuredContent)
189190
continue
190191
}
191192

192193
require.NotNil(t, result.StructuredContent, "%s must return structured content", call.name)
193194
structuredJSON := mustMarshalJSON(t, result.StructuredContent)
194-
assert.JSONEq(t, call.text, structuredJSON)
195+
assert.JSONEq(t, call.text, text)
196+
assert.JSONEq(t, text, structuredJSON, "modern text must serialize the typed DTO")
195197

196198
var schema jsonschema.Schema
197199
require.NoError(t, json.Unmarshal([]byte(mustMarshalJSON(t, outputSchemas[call.name].OutputSchema)), &schema))

0 commit comments

Comments
 (0)