(t *testing.T)
| 799 | } |
| 800 | |
| 801 | func TestReduce(t *testing.T) { |
| 802 | tests := map[string]int{ |
| 803 | "-0": 0, |
| 804 | "0": 0, |
| 805 | "0.0": 0, |
| 806 | "00": 0, |
| 807 | "0.00": 0, |
| 808 | "-01000": 3, |
| 809 | "01000": 3, |
| 810 | "-1": 0, |
| 811 | "1": 0, |
| 812 | "-10.000E4": 4, |
| 813 | "10.000E4": 4, |
| 814 | "-10.00": 3, |
| 815 | "10.00": 3, |
| 816 | "-10": 1, |
| 817 | "10": 1, |
| 818 | "-143200000000000000000000000000000000000000000000000000000000": 56, |
| 819 | "143200000000000000000000000000000000000000000000000000000000": 56, |
| 820 | "Inf": 0, |
| 821 | "NaN": 0, |
| 822 | } |
| 823 | |
| 824 | for s, n := range tests { |
| 825 | t.Run(s, func(t *testing.T) { |
| 826 | d, _, err := NewFromString(s) |
| 827 | if err != nil { |
| 828 | t.Fatal(err) |
| 829 | } |
| 830 | _, got := d.Reduce(d) |
| 831 | if n != got { |
| 832 | t.Fatalf("got %v, expected %v", got, n) |
| 833 | } |
| 834 | }) |
| 835 | } |
| 836 | } |
| 837 | |
| 838 | // TestSizeof is meant to catch changes that unexpectedly increase |
| 839 | // the size of the BigInt, Decimal, and Context structs. |
nothing calls this directly
no test coverage detected
searching dependent graphs…