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

Function TestIncrementWithInt

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

Source from the content-addressed store, hash-verified

155}
156
157func TestIncrementWithInt(t *testing.T) {
158 tc := New(DefaultExpiration, 0)
159 tc.Set("tint", 1, DefaultExpiration)
160 err := tc.Increment("tint", 2)
161 if err != nil {
162 t.Error("Error incrementing:", err)
163 }
164 x, found := tc.Get("tint")
165 if !found {
166 t.Error("tint was not found")
167 }
168 if x.(int) != 3 {
169 t.Error("tint is not 3:", x)
170 }
171}
172
173func TestIncrementWithInt8(t *testing.T) {
174 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…