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

Function TestComputeRunMetricsDiff_TokensPerTurnZeroTurns

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

Source from the content-addressed store, hash-verified

1393}
1394
1395func TestComputeRunMetricsDiff_TokensPerTurnZeroTurns(t *testing.T) {
1396 // When turns = 0, tokens per turn should remain 0 (no division)
1397 summary1 := &RunSummary{
1398 Run: WorkflowRun{
1399 TokenUsage: 5000,
1400 Turns: 0,
1401 },
1402 }
1403 summary2 := &RunSummary{
1404 Run: WorkflowRun{
1405 TokenUsage: 8000,
1406 Turns: 4,
1407 },
1408 }
1409
1410 diff := computeRunMetricsDiff(summary1, summary2)
1411 require.NotNil(t, diff, "Should produce metrics diff")
1412
1413 assert.Equal(t, 0, diff.Run1TokensPerTurn, "Run1 tokens/turn should be 0 when turns=0")
1414 assert.Equal(t, 2000, diff.Run2TokensPerTurn, "Run2 tokens/turn should be 8000/4=2000")
1415}
1416
1417// --- Tool calls diff in RunMetricsDiff integration test ---
1418

Callers

nothing calls this directly

Calls 1

computeRunMetricsDiffFunction · 0.85

Tested by

no test coverage detected