(t *testing.T)
| 730 | } |
| 731 | |
| 732 | func TestIncrementInt64(t *testing.T) { |
| 733 | tc := New(DefaultExpiration, 0) |
| 734 | tc.Set("tint64", int64(1), DefaultExpiration) |
| 735 | n, err := tc.IncrementInt64("tint64", 2) |
| 736 | if err != nil { |
| 737 | t.Error("Error incrementing:", err) |
| 738 | } |
| 739 | if n != 3 { |
| 740 | t.Error("Returned number is not 3:", n) |
| 741 | } |
| 742 | x, found := tc.Get("tint64") |
| 743 | if !found { |
| 744 | t.Error("tint64 was not found") |
| 745 | } |
| 746 | if x.(int64) != 3 { |
| 747 | t.Error("tint64 is not 3:", x) |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | func TestIncrementUint(t *testing.T) { |
| 752 | tc := New(DefaultExpiration, 0) |
nothing calls this directly
no test coverage detected