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

Function TestDecrementFloatWithFloat64

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

Source from the content-addressed store, hash-verified

638}
639
640func TestDecrementFloatWithFloat64(t *testing.T) {
641 tc := New(DefaultExpiration, 0)
642 tc.Set("float64", float64(5.5), DefaultExpiration)
643 err := tc.DecrementFloat("float64", 2)
644 if err != nil {
645 t.Error("Error decrementing:", err)
646 }
647 x, found := tc.Get("float64")
648 if !found {
649 t.Error("float64 was not found")
650 }
651 if x.(float64) != 3.5 {
652 t.Error("float64 is not 3:", x)
653 }
654}
655
656func TestIncrementInt(t *testing.T) {
657 tc := New(DefaultExpiration, 0)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected