mirror of
https://github.com/restic/restic.git
synced 2025-08-26 12:47:42 +00:00
cache: correctly ignore files whose filename is no ID
this can for example be the case for temporary files created by the backend implementation.
This commit is contained in:
17
internal/backend/cache/backend_test.go
vendored
17
internal/backend/cache/backend_test.go
vendored
@@ -296,3 +296,20 @@ func TestAutomaticCacheClear(t *testing.T) {
|
||||
t.Errorf("cache doesn't have file2 after list")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAutomaticCacheClearInvalidFilename(t *testing.T) {
|
||||
be := mem.New()
|
||||
c := TestNewCache(t)
|
||||
|
||||
data := test.Random(rand.Int(), 42)
|
||||
h := backend.Handle{
|
||||
Type: backend.IndexFile,
|
||||
Name: "tmp12345",
|
||||
}
|
||||
save(t, be, h, data)
|
||||
|
||||
wbe := c.Wrap(be)
|
||||
|
||||
// list all files in the backend
|
||||
list(t, wbe, func(_ backend.FileInfo) error { return nil })
|
||||
}
|
||||
|
Reference in New Issue
Block a user