(b *testing.B)
| 250 | } |
| 251 | |
| 252 | func BenchmarkDecimal_NewFromString(b *testing.B) { |
| 253 | count := 72 |
| 254 | prices := make([]string, 0, count) |
| 255 | for i := 1; i <= count; i++ { |
| 256 | prices = append(prices, fmt.Sprintf("%d.%d", i*100, i)) |
| 257 | } |
| 258 | |
| 259 | b.ReportAllocs() |
| 260 | b.ResetTimer() |
| 261 | for i := 0; i < b.N; i++ { |
| 262 | for _, p := range prices { |
| 263 | d, err := NewFromString(p) |
| 264 | if err != nil { |
| 265 | b.Log(d) |
| 266 | b.Error(err) |
| 267 | } |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | func BenchmarkDecimal_NewFromString_large_number(b *testing.B) { |
| 273 | count := 72 |
nothing calls this directly
no test coverage detected
searching dependent graphs…