(t *testing.T)
| 661 | } |
| 662 | |
| 663 | func TestParseLogFileWithNonCodexTokensOnly(t *testing.T) { |
| 664 | // Create a temporary log file with only non-Codex token formats |
| 665 | tmpDir := testutil.TempDir(t, "test-*") |
| 666 | logFile := filepath.Join(tmpDir, "test-generic-tokens.log") |
| 667 | |
| 668 | // Only non-Codex formats - should keep maximum behavior |
| 669 | logContent := `tokens: 5000 |
| 670 | token_count: 10000 |
| 671 | input_tokens: 2000` |
| 672 | |
| 673 | err := os.WriteFile(logFile, []byte(logContent), 0644) |
| 674 | if err != nil { |
| 675 | t.Fatalf("Failed to create test log file: %v", err) |
| 676 | } |
| 677 | |
| 678 | // Without aw_info.json and specific engine, should return empty metrics |
| 679 | metrics, err := parseLogFileWithEngine(logFile, nil, false, false) |
| 680 | if err != nil { |
| 681 | t.Fatalf("parseLogFileWithEngine failed: %v", err) |
| 682 | } |
| 683 | |
| 684 | // Without engine-specific parsing, should return 0 |
| 685 | if metrics.TokenUsage != 0 { |
| 686 | t.Errorf("Expected token usage 0 (no aw_info.json), got %d", metrics.TokenUsage) |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | func TestExtractLogMetricsWithAwOutputFile(t *testing.T) { |
| 691 | // Create a temporary directory structure |
nothing calls this directly
no test coverage detected