(t *testing.T)
| 219 | } |
| 220 | |
| 221 | func TestIncrementWithInt64(t *testing.T) { |
| 222 | tc := New(DefaultExpiration, 0) |
| 223 | tc.Set("tint64", int64(1), DefaultExpiration) |
| 224 | err := tc.Increment("tint64", 2) |
| 225 | if err != nil { |
| 226 | t.Error("Error incrementing:", err) |
| 227 | } |
| 228 | x, found := tc.Get("tint64") |
| 229 | if !found { |
| 230 | t.Error("tint64 was not found") |
| 231 | } |
| 232 | if x.(int64) != 3 { |
| 233 | t.Error("tint64 is not 3:", x) |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | func TestIncrementWithUint(t *testing.T) { |
| 238 | tc := New(DefaultExpiration, 0) |