MCPcopy
hub / github.com/rclone/rclone / TestGetMaybe

Function TestGetMaybe

lib/cache/cache_test.go:250–269  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

248}
249
250func TestGetMaybe(t *testing.T) {
251 c, create := setup(t)
252
253 value, found := c.GetMaybe("/")
254 assert.Equal(t, false, found)
255 assert.Nil(t, value)
256
257 f, err := c.Get("/", create)
258 require.NoError(t, err)
259
260 value, found = c.GetMaybe("/")
261 assert.Equal(t, true, found)
262 assert.Equal(t, f, value)
263
264 c.Clear()
265
266 value, found = c.GetMaybe("/")
267 assert.Equal(t, false, found)
268 assert.Nil(t, value)
269}
270
271func TestDelete(t *testing.T) {
272 c, create := setup(t)

Callers

nothing calls this directly

Calls 5

setupFunction · 0.85
GetMaybeMethod · 0.80
GetMethod · 0.65
EqualMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…