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

Function TestAdd

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

Source from the content-addressed store, hash-verified

1129}
1130
1131func TestAdd(t *testing.T) {
1132 tc := New(DefaultExpiration, 0)
1133 err := tc.Add("foo", "bar", DefaultExpiration)
1134 if err != nil {
1135 t.Error("Couldn't add foo even though it shouldn't exist")
1136 }
1137 err = tc.Add("foo", "baz", DefaultExpiration)
1138 if err == nil {
1139 t.Error("Successfully added another foo when it should have returned an error")
1140 }
1141}
1142
1143func TestReplace(t *testing.T) {
1144 tc := New(DefaultExpiration, 0)

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
AddMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected