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

Function TestComputeToolCallsDiff_RemovedTools

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

Source from the content-addressed store, hash-verified

1150}
1151
1152func TestComputeToolCallsDiff_RemovedTools(t *testing.T) {
1153 m1 := &LogMetrics{
1154 ToolCalls: []ToolCallInfo{
1155 {Name: "bash", CallCount: 8},
1156 {Name: "gh", CallCount: 4},
1157 {Name: "edit", CallCount: 2},
1158 },
1159 }
1160 m2 := &LogMetrics{
1161 ToolCalls: []ToolCallInfo{
1162 {Name: "bash", CallCount: 6},
1163 },
1164 }
1165
1166 diff := computeToolCallsDiff(m1, m2)
1167 require.NotNil(t, diff, "Should produce diff")
1168
1169 assert.Len(t, diff.RemovedTools, 2, "Should have 2 removed tools (gh, edit)")
1170 assert.Empty(t, diff.NewTools, "Should have no new tools")
1171
1172 assert.Equal(t, 2, diff.Summary.RemovedToolCount, "Summary should show 2 removed tools")
1173 assert.Equal(t, 14, diff.Summary.Run1TotalCalls, "Run1 total should be 14")
1174 assert.Equal(t, 6, diff.Summary.Run2TotalCalls, "Run2 total should be 6")
1175}
1176
1177func TestComputeToolCallsDiff_ChangedTools(t *testing.T) {
1178 m1 := &LogMetrics{

Callers

nothing calls this directly

Calls 1

computeToolCallsDiffFunction · 0.85

Tested by

no test coverage detected