This commit is contained in:
2026-06-22 08:55:57 +08:00
parent dbb87823e8
commit 6ade6e8fa9
325 changed files with 41131 additions and 855 deletions
+13
View File
@@ -30,6 +30,19 @@ func TestComputeCost_BasicMath(t *testing.T) {
require.InDelta(t, 0.021, got, 1e-9)
}
// TestExportedComputeCost_EqualsUnexported guards that the exported ComputeCost
// (reused by internal/acp) returns identical results to the unexported alias.
func TestExportedComputeCost_EqualsUnexported(t *testing.T) {
m := LLMModel{
PromptPricePerMillionUSD: 3.0,
CompletionPricePerMillionUSD: 15.0,
ThinkingPricePerMillionUSD: 3.0,
}
for _, c := range [][3]int{{1000, 0, 0}, {0, 1000, 0}, {0, 0, 1000}, {1234, 5678, 90}} {
require.Equal(t, computeCost(m, c[0], c[1], c[2]), ComputeCost(m, c[0], c[1], c[2]))
}
}
func TestComputeCost_ZeroTokens(t *testing.T) {
m := LLMModel{
PromptPricePerMillionUSD: 3.0,