Commit 5e54d492 authored by shaw's avatar shaw
Browse files

fix(lint): check type assertion error in codex transform test

The errcheck linter flagged an unchecked type assertion on
item["type"].(string). Use the two-value form with require.True
to satisfy the linter and fail clearly on unexpected types.
parent 8d6d3154
......@@ -1176,7 +1176,9 @@ func TestFilterCodexInput_DropsReasoningItemsRegardlessOfPreserveReferences(t *t
for _, raw := range filtered {
item, ok := raw.(map[string]any)
require.True(t, ok)
gotTypes[item["type"].(string)]++
typ, ok := item["type"].(string)
require.True(t, ok)
gotTypes[typ]++
}
require.Equal(t, 1, gotTypes["message"])
require.Equal(t, 1, gotTypes["function_call"])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment