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

Function TestIncrementFloatWithFloat32

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

Source from the content-addressed store, hash-verified

382}
383
384func TestIncrementFloatWithFloat32(t *testing.T) {
385 tc := New(DefaultExpiration, 0)
386 tc.Set("float32", float32(1.5), DefaultExpiration)
387 err := tc.IncrementFloat("float32", 2)
388 if err != nil {
389 t.Error("Error incrementfloating:", err)
390 }
391 x, found := tc.Get("float32")
392 if !found {
393 t.Error("float32 was not found")
394 }
395 if x.(float32) != 3.5 {
396 t.Error("float32 is not 3.5:", x)
397 }
398}
399
400func TestIncrementFloatWithFloat64(t *testing.T) {
401 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