| 623 | } |
| 624 | |
| 625 | func TestCopy(t *testing.T) { |
| 626 | origin := New(1, 0) |
| 627 | cpy := origin.Copy() |
| 628 | |
| 629 | if origin.value == cpy.value { |
| 630 | t.Error("expecting copy and origin to have different value pointers") |
| 631 | } |
| 632 | |
| 633 | if cpy.Cmp(origin) != 0 { |
| 634 | t.Error("expecting copy and origin to be equals, but they are not") |
| 635 | } |
| 636 | |
| 637 | //change value |
| 638 | cpy = cpy.Add(New(1, 0)) |
| 639 | |
| 640 | if cpy.Cmp(origin) == 0 { |
| 641 | t.Error("expecting copy and origin to have different values, but they are equal") |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | func TestJSON(t *testing.T) { |
| 646 | for _, x := range testTable { |