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

Function TestSerializeUnserializable

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

Source from the content-addressed store, hash-verified

1430}
1431
1432func TestSerializeUnserializable(t *testing.T) {
1433 tc := New(DefaultExpiration, 0)
1434 ch := make(chan bool, 1)
1435 ch <- true
1436 tc.Set("chan", ch, DefaultExpiration)
1437 fp := &bytes.Buffer{}
1438 err := tc.Save(fp) // this should fail gracefully
1439 if err.Error() != "gob NewTypeObject can't handle type: chan bool" {
1440 t.Error("Error from Save was not gob NewTypeObject can't handle type chan bool:", err)
1441 }
1442}
1443
1444func BenchmarkCacheGetExpiring(b *testing.B) {
1445 benchmarkCacheGet(b, 5*time.Minute)

Callers

nothing calls this directly

Calls 4

SaveMethod · 0.80
NewFunction · 0.70
SetMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected