(t *testing.T)
| 1737 | } |
| 1738 | |
| 1739 | func TestDecimal_Neg(t *testing.T) { |
| 1740 | inputs := map[string]string{ |
| 1741 | "0": "0", |
| 1742 | "10": "-10", |
| 1743 | "5.56": "-5.56", |
| 1744 | "-10": "10", |
| 1745 | "-5.56": "5.56", |
| 1746 | } |
| 1747 | |
| 1748 | for inp, res := range inputs { |
| 1749 | a, err := NewFromString(inp) |
| 1750 | if err != nil { |
| 1751 | t.FailNow() |
| 1752 | } |
| 1753 | b := a.Neg() |
| 1754 | if b.String() != res { |
| 1755 | t.Errorf("expected %s, got %s", res, b.String()) |
| 1756 | } |
| 1757 | } |
| 1758 | } |
| 1759 | |
| 1760 | func TestDecimal_NegFromEmpty(t *testing.T) { |
| 1761 | a := Decimal{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…