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

Function TestIncrementWithInt16

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

Source from the content-addressed store, hash-verified

187}
188
189func TestIncrementWithInt16(t *testing.T) {
190 tc := New(DefaultExpiration, 0)
191 tc.Set("tint16", int16(1), DefaultExpiration)
192 err := tc.Increment("tint16", 2)
193 if err != nil {
194 t.Error("Error incrementing:", err)
195 }
196 x, found := tc.Get("tint16")
197 if !found {
198 t.Error("tint16 was not found")
199 }
200 if x.(int16) != 3 {
201 t.Error("tint16 is not 3:", x)
202 }
203}
204
205func TestIncrementWithInt32(t *testing.T) {
206 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…