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

Function TestIncrementWithInt8

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

Source from the content-addressed store, hash-verified

171}
172
173func TestIncrementWithInt8(t *testing.T) {
174 tc := New(DefaultExpiration, 0)
175 tc.Set("tint8", int8(1), DefaultExpiration)
176 err := tc.Increment("tint8", 2)
177 if err != nil {
178 t.Error("Error incrementing:", err)
179 }
180 x, found := tc.Get("tint8")
181 if !found {
182 t.Error("tint8 was not found")
183 }
184 if x.(int8) != 3 {
185 t.Error("tint8 is not 3:", x)
186 }
187}
188
189func TestIncrementWithInt16(t *testing.T) {
190 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…