(t *testing.T)
| 326 | } |
| 327 | |
| 328 | func TestFloat64(t *testing.T) { |
| 329 | tests := []float64{ |
| 330 | 0, |
| 331 | 1, |
| 332 | -1, |
| 333 | math.MaxFloat32, |
| 334 | math.SmallestNonzeroFloat32, |
| 335 | math.MaxFloat64, |
| 336 | math.SmallestNonzeroFloat64, |
| 337 | } |
| 338 | |
| 339 | for _, tc := range tests { |
| 340 | t.Run(fmt.Sprint(tc), func(t *testing.T) { |
| 341 | d := new(Decimal) |
| 342 | d.SetFloat64(tc) |
| 343 | f, err := d.Float64() |
| 344 | if err != nil { |
| 345 | t.Fatal(err) |
| 346 | } |
| 347 | if tc != f { |
| 348 | t.Fatalf("expected %v, got %v", tc, f) |
| 349 | } |
| 350 | }) |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | func TestCeil(t *testing.T) { |
| 355 | tests := map[float64]int64{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…