(t *testing.T)
| 775 | } |
| 776 | |
| 777 | func TestNeg(t *testing.T) { |
| 778 | tests := map[string]string{ |
| 779 | "0": "0", |
| 780 | "-0": "0", |
| 781 | "-0.000": "0.000", |
| 782 | "-00.000100": "0.000100", |
| 783 | } |
| 784 | |
| 785 | for tc, expect := range tests { |
| 786 | t.Run(tc, func(t *testing.T) { |
| 787 | d, _, err := NewFromString(tc) |
| 788 | if err != nil { |
| 789 | t.Fatal(err) |
| 790 | } |
| 791 | var z Decimal |
| 792 | z.Neg(d) |
| 793 | s := z.String() |
| 794 | if s != expect { |
| 795 | t.Fatalf("expected %s, got %s", expect, s) |
| 796 | } |
| 797 | }) |
| 798 | } |
| 799 | } |
| 800 | |
| 801 | func TestReduce(t *testing.T) { |
| 802 | tests := map[string]int{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…