updated restore backup warning message and changed archive.Extract to ignore irregular files

This commit is contained in:
Gani Georgiev
2024-03-17 15:43:27 +02:00
parent be40803d31
commit 48153d4542
36 changed files with 81 additions and 56 deletions
+3 -2
View File
@@ -37,7 +37,7 @@ func TestExtractSuccess(t *testing.T) {
defer os.RemoveAll(extractedPath)
// zip testDir content (with exclude)
if err := archive.Create(testDir, zipPath, "a/b/c", "test", "sub2"); err != nil {
if err := archive.Create(testDir, zipPath, "a/b/c", "test2", "sub2"); err != nil {
t.Fatalf("Failed to create archive: %v", err)
}
@@ -64,8 +64,9 @@ func TestExtractSuccess(t *testing.T) {
t.Fatalf("Failed to read the extracted dir: %v", walkErr)
}
// (note: symbolic links and other regular files should be missing)
expectedFiles := []string{
filepath.Join(extractedPath, "test2"),
filepath.Join(extractedPath, "test"),
filepath.Join(extractedPath, "a/test"),
filepath.Join(extractedPath, "a/b/sub1"),
}