(t *testing.T)
| 958 | } |
| 959 | |
| 960 | func TestDecrementInt64(t *testing.T) { |
| 961 | tc := New(DefaultExpiration, 0) |
| 962 | tc.Set("int64", int64(5), DefaultExpiration) |
| 963 | n, err := tc.DecrementInt64("int64", 2) |
| 964 | if err != nil { |
| 965 | t.Error("Error decrementing:", err) |
| 966 | } |
| 967 | if n != 3 { |
| 968 | t.Error("Returned number is not 3:", n) |
| 969 | } |
| 970 | x, found := tc.Get("int64") |
| 971 | if !found { |
| 972 | t.Error("int64 was not found") |
| 973 | } |
| 974 | if x.(int64) != 3 { |
| 975 | t.Error("int64 is not 3:", x) |
| 976 | } |
| 977 | } |
| 978 | |
| 979 | func TestDecrementUint(t *testing.T) { |
| 980 | tc := New(DefaultExpiration, 0) |
nothing calls this directly
no test coverage detected