MCPcopy
hub / github.com/rclone/rclone / TestCacheNoExpire

Function TestCacheNoExpire

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

Source from the content-addressed store, hash-verified

144}
145
146func TestCacheNoExpire(t *testing.T) {
147 c, create := setup(t)
148
149 assert.False(t, c.noCache())
150
151 c.SetExpireDuration(0)
152 assert.Equal(t, false, c.expireRunning)
153
154 assert.True(t, c.noCache())
155
156 f, err := c.Get("/", create)
157 require.NoError(t, err)
158 require.NotNil(t, f)
159
160 c.mu.Lock()
161 assert.Equal(t, 0, len(c.cache))
162 c.mu.Unlock()
163
164 c.Put("/alien", "slime")
165
166 c.mu.Lock()
167 assert.Equal(t, 0, len(c.cache))
168 c.mu.Unlock()
169}
170
171func TestCachePin(t *testing.T) {
172 c, create := setup(t)

Callers

nothing calls this directly

Calls 8

setupFunction · 0.85
noCacheMethod · 0.80
SetExpireDurationMethod · 0.80
GetMethod · 0.65
LockMethod · 0.65
UnlockMethod · 0.65
PutMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…