(t *testing.T)
| 1150 | } |
| 1151 | |
| 1152 | func 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 | |
| 1177 | func TestComputeToolCallsDiff_ChangedTools(t *testing.T) { |
| 1178 | m1 := &LogMetrics{ |
nothing calls this directly
no test coverage detected