|
87 | 87 | (agent/say-final "Added features" nil) => (contains "Sent via gemini-3.1-pro-preview | Cost: $1.00")) |
88 | 88 | (fact "say-final accepts actual-cost and prints it correctly in the footer" |
89 | 89 | (agent/say-final "Added features" nil 0.12) => (contains "Sent via gemini-3.1-pro-preview | Cost: $0.12") |
90 | | - (agent/say-final "Added features" nil 1.234) => (contains "Sent via gemini-3.1-pro-preview | Cost: $1.23")) |
| 90 | + (agent/say-final "Added features" nil 1.234) => (contains "Sent via gemini-3.1-pro-preview | Cost: $1.23") |
| 91 | + (agent/say-final "Added features" nil 0.000475) => (contains "Sent via gemini-3.1-pro-preview | Cost: $0.0005") |
| 92 | + (agent/say-final "Added features" nil 0.004) => (contains "Sent via gemini-3.1-pro-preview | Cost: $0.0040") |
| 93 | + (agent/say-final "Added features" nil 0.0) => (contains "Sent via gemini-3.1-pro-preview | Cost: $0.00")) |
91 | 94 | (fact "say-timeout names the limit" |
92 | 95 | (agent/say-timeout 5) => (contains "5 min"))) |
93 | 96 |
|
| 97 | +(facts "about format-cost" |
| 98 | + (fact "nil or zero costs return 0.00" |
| 99 | + (agent/format-cost nil) => "0.00" |
| 100 | + (agent/format-cost 0) => "0.00" |
| 101 | + (agent/format-cost 0.0) => "0.00") |
| 102 | + (fact "costs under 0.01 are formatted to 4 decimal places" |
| 103 | + (agent/format-cost 0.000475) => "0.0005" |
| 104 | + (agent/format-cost 0.004) => "0.0040" |
| 105 | + (agent/format-cost 0.0099) => "0.0099") |
| 106 | + (fact "costs 0.01 or above are formatted to 2 decimal places" |
| 107 | + (agent/format-cost 0.01) => "0.01" |
| 108 | + (agent/format-cost 0.12) => "0.12" |
| 109 | + (agent/format-cost 1.234) => "1.23")) |
| 110 | + |
94 | 111 | (facts "about agent limits config defaults" |
95 | 112 | (fact "default timeout is 15 minutes" |
96 | 113 | (agent/agent-timeout-ms) => 900000) |
|
0 commit comments