MCPcopy Index your code
hub / github.com/patrickmn/go-cache / TestAdd

Function TestAdd

cache_test.go:1115–1125  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1113}
1114
1115func TestAdd(t *testing.T) {
1116 tc := New(DefaultExpiration, 0)
1117 err := tc.Add("foo", "bar", DefaultExpiration)
1118 if err != nil {
1119 t.Error("Couldn't add foo even though it shouldn't exist")
1120 }
1121 err = tc.Add("foo", "baz", DefaultExpiration)
1122 if err == nil {
1123 t.Error("Successfully added another foo when it should have returned an error")
1124 }
1125}
1126
1127func TestReplace(t *testing.T) {
1128 tc := New(DefaultExpiration, 0)

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…