MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / TestFormatPrice

Function TestFormatPrice

utils/pricing_test.go:185–201  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

183}
184
185func TestFormatPrice(t *testing.T) {
186 tests := []struct {
187 price float64
188 expected string
189 }{
190 {0, "$0.00/hr"},
191 {1.5, "$1.50/hr"},
192 {0.123, "$0.12/hr"},
193 {10.999, "$11.00/hr"},
194 }
195
196 for _, tt := range tests {
197 t.Run(tt.expected, func(t *testing.T) {
198 assert.Equal(t, tt.expected, FormatPrice(tt.price))
199 })
200 }
201}

Callers

nothing calls this directly

Calls 1

FormatPriceFunction · 0.85

Tested by

no test coverage detected