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

Function TestComputeBashCommandsDiff_GenericBash

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

Source from the content-addressed store, hash-verified

1267}
1268
1269func TestComputeBashCommandsDiff_GenericBash(t *testing.T) {
1270 // Only bash tools are passed to computeBashCommandsDiff
1271 run1Tools := map[string]ToolCallInfo{
1272 "bash": {Name: "bash", CallCount: 5},
1273 }
1274 run2Tools := map[string]ToolCallInfo{
1275 "bash": {Name: "bash", CallCount: 10},
1276 }
1277
1278 result := computeBashCommandsDiff(run1Tools, run2Tools)
1279 require.NotNil(t, result, "Should produce bash diff when bash tool present")
1280
1281 assert.Equal(t, 5, result.Run1TotalCalls, "Run1 total bash calls should be 5")
1282 assert.Equal(t, 10, result.Run2TotalCalls, "Run2 total bash calls should be 10")
1283 assert.Equal(t, "+5", result.TotalCallsChange, "Total change should be +5")
1284
1285 require.Len(t, result.Commands, 1, "Should have 1 command (bash)")
1286 assert.Equal(t, "bash", result.Commands[0].Name, "Command should be bash")
1287 assert.Equal(t, "changed", result.Commands[0].Status, "bash status should be changed")
1288 assert.Equal(t, "+5", result.Commands[0].CallCountChange, "bash change should be +5")
1289}
1290
1291func TestComputeBashCommandsDiff_PerCommandTracking(t *testing.T) {
1292 // Codex-style per-command bash tracking

Callers

nothing calls this directly

Calls 1

computeBashCommandsDiffFunction · 0.85

Tested by

no test coverage detected