Skip to content

Commit a8bf017

Browse files
committed
Add test for consecutive directory removal
Signed-off-by: Derek McGowan <[email protected]>
1 parent 53aaa89 commit a8bf017

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

archive/tar_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,24 @@ func TestDiffTar(t *testing.T) {
988988
fstest.RemoveAll("/d5"),
989989
),
990990
},
991+
{
992+
name: "WhiteoutParentRemoval",
993+
validators: []tarEntryValidator{
994+
whiteoutEntry("d1"),
995+
whiteoutEntry("d2"),
996+
dirEntry("d3/", 0755),
997+
},
998+
a: fstest.Apply(
999+
fstest.CreateDir("/d1/", 0755),
1000+
fstest.CreateDir("/d2/", 0755),
1001+
fstest.CreateFile("/d2/f1", []byte("content"), 0644),
1002+
),
1003+
b: fstest.Apply(
1004+
fstest.RemoveAll("/d1"),
1005+
fstest.RemoveAll("/d2"),
1006+
fstest.CreateDir("/d3/", 0755),
1007+
),
1008+
},
9911009
}
9921010

9931011
for _, at := range tests {

0 commit comments

Comments
 (0)