MCPcopy Create free account
hub / github.com/github/gh-aw / TestComputeToolCallsDiff_SortedOutput

Function TestComputeToolCallsDiff_SortedOutput

pkg/cli/audit_diff_test.go:1239–1257  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1237}
1238
1239func TestComputeToolCallsDiff_SortedOutput(t *testing.T) {
1240 m1 := &LogMetrics{}
1241 m2 := &LogMetrics{
1242 ToolCalls: []ToolCallInfo{
1243 {Name: "z-tool", CallCount: 1},
1244 {Name: "a-tool", CallCount: 1},
1245 {Name: "m-tool", CallCount: 1},
1246 },
1247 }
1248
1249 diff := computeToolCallsDiff(m1, m2)
1250 require.NotNil(t, diff, "Should produce diff")
1251 require.Len(t, diff.AllTools, 3, "Should have 3 tools in AllTools")
1252
1253 // AllTools is built from sorted keys
1254 assert.Equal(t, "a-tool", diff.AllTools[0].Name, "First tool should be a-tool (sorted)")
1255 assert.Equal(t, "m-tool", diff.AllTools[1].Name, "Second tool should be m-tool (sorted)")
1256 assert.Equal(t, "z-tool", diff.AllTools[2].Name, "Third tool should be z-tool (sorted)")
1257}
1258
1259// --- Bash commands diff tests ---
1260

Callers

nothing calls this directly

Calls 1

computeToolCallsDiffFunction · 0.85

Tested by

no test coverage detected