add hardlink test

This commit is contained in:
Motiejus Jakštys 2021-05-24 00:11:58 +03:00
parent cb1045db17
commit d372a538ce
1 changed files with 15 additions and 0 deletions

View File

@ -64,6 +64,21 @@ func TestRootFS(t *testing.T) {
file{Name: "/file", Uid: 1, Contents: bytes.NewBufferString("from 1")},
},
},
{
name: "overwrite file with hardlink",
image: tarball{
file{Name: "layer0/layer.tar", Contents: tarball{
file{Name: "a"},
}},
file{Name: "layer1/layer.tar", Contents: tarball{
hardlink{Name: "a"},
}},
manifest{"layer0/layer.tar", "layer1/layer.tar"},
},
want: []extractable{
hardlink{Name: "a"},
},
},
{
name: "directory overwrite retains original dir",
image: tarball{