mirror of
https://github.com/rclone/rclone.git
synced 2025-08-14 07:49:00 +02:00
fs/cache: add Entries() for finding how many entries in the fscache #4811
This commit is contained in:
13
fs/cache/cache_test.go
vendored
13
fs/cache/cache_test.go
vendored
@ -180,3 +180,16 @@ func TestClear(t *testing.T) {
|
||||
|
||||
assert.Equal(t, 0, c.Entries())
|
||||
}
|
||||
|
||||
func TestEntries(t *testing.T) {
|
||||
cleanup, create := mockNewFs(t)
|
||||
defer cleanup()
|
||||
|
||||
assert.Equal(t, 0, Entries())
|
||||
|
||||
// Create something
|
||||
_, err := GetFn(context.Background(), "mock:/", create)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, 1, Entries())
|
||||
}
|
||||
|
Reference in New Issue
Block a user