Add test for consecutive directory removal

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan 2018-02-12 10:43:16 -08:00
parent 7022a19a4c
commit 2a2c8aafba
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB

View File

@ -988,6 +988,24 @@ func TestDiffTar(t *testing.T) {
fstest.RemoveAll("/d5"),
),
},
{
name: "WhiteoutParentRemoval",
validators: []tarEntryValidator{
whiteoutEntry("d1"),
whiteoutEntry("d2"),
dirEntry("d3/", 0755),
},
a: fstest.Apply(
fstest.CreateDir("/d1/", 0755),
fstest.CreateDir("/d2/", 0755),
fstest.CreateFile("/d2/f1", []byte("content"), 0644),
),
b: fstest.Apply(
fstest.RemoveAll("/d1"),
fstest.RemoveAll("/d2"),
fstest.CreateDir("/d3/", 0755),
),
},
}
for _, at := range tests {