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

Function TestIncrementWithInt32

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

Source from the content-addressed store, hash-verified

203}
204
205func TestIncrementWithInt32(t *testing.T) {
206 tc := New(DefaultExpiration, 0)
207 tc.Set("tint32", int32(1), DefaultExpiration)
208 err := tc.Increment("tint32", 2)
209 if err != nil {
210 t.Error("Error incrementing:", err)
211 }
212 x, found := tc.Get("tint32")
213 if !found {
214 t.Error("tint32 was not found")
215 }
216 if x.(int32) != 3 {
217 t.Error("tint32 is not 3:", x)
218 }
219}
220
221func TestIncrementWithInt64(t *testing.T) {
222 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…