MCPcopy Create free account
hub / github.com/patrickmn/go-cache / TestIncrementWithInt64

Function TestIncrementWithInt64

cache_test.go:221–235  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

219}
220
221func 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
237func TestIncrementWithUint(t *testing.T) {
238 tc := New(DefaultExpiration, 0)

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetMethod · 0.45
IncrementMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…