MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / TestIncrementFloatWithFloat64

Function TestIncrementFloatWithFloat64

pkg/util/cache/cache_test.go:400–414  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

398}
399
400func TestIncrementFloatWithFloat64(t *testing.T) {
401 tc := New(DefaultExpiration, 0)
402 tc.Set("float64", float64(1.5), DefaultExpiration)
403 err := tc.IncrementFloat("float64", 2)
404 if err != nil {
405 t.Error("Error incrementfloating:", err)
406 }
407 x, found := tc.Get("float64")
408 if !found {
409 t.Error("float64 was not found")
410 }
411 if x.(float64) != 3.5 {
412 t.Error("float64 is not 3.5:", x)
413 }
414}
415
416func TestDecrementWithInt(t *testing.T) {
417 tc := New(DefaultExpiration, 0)

Callers

nothing calls this directly

Calls 5

IncrementFloatMethod · 0.80
NewFunction · 0.70
SetMethod · 0.65
GetMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected