(t *testing.T)
| 183 | } |
| 184 | |
| 185 | func 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 | } |
nothing calls this directly
no test coverage detected