summaryrefslogtreecommitdiff
path: root/zip/zip_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'zip/zip_test.go')
-rw-r--r--zip/zip_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/zip/zip_test.go b/zip/zip_test.go
index e77801b91..a08fb126d 100644
--- a/zip/zip_test.go
+++ b/zip/zip_test.go
@@ -105,6 +105,7 @@ func TestZip(t *testing.T) {
nonDeflatedFiles map[string]bool
dirEntries bool
manifest string
+ storeSymlinks bool
files []zip.FileHeader
err error
@@ -135,6 +136,7 @@ func TestZip(t *testing.T) {
SourcePrefixToStrip("a").
File("a/**/*"),
compressionLevel: 9,
+ storeSymlinks: true,
files: []zip.FileHeader{
fh("a/a", fileA, zip.Deflate),
@@ -149,6 +151,7 @@ func TestZip(t *testing.T) {
SourcePrefixToStrip("a").
Dir("a"),
compressionLevel: 9,
+ storeSymlinks: true,
files: []zip.FileHeader{
fh("a/a", fileA, zip.Deflate),
@@ -179,6 +182,7 @@ func TestZip(t *testing.T) {
File("a/a/c").
File("a/a/d"),
compressionLevel: 9,
+ storeSymlinks: true,
files: []zip.FileHeader{
fh("a/a/a", fileA, zip.Deflate),
@@ -188,6 +192,23 @@ func TestZip(t *testing.T) {
},
},
{
+ name: "follow symlinks",
+ args: fileArgsBuilder().
+ File("a/a/a").
+ File("a/a/b").
+ File("a/a/c").
+ File("a/a/d"),
+ compressionLevel: 9,
+ storeSymlinks: false,
+
+ files: []zip.FileHeader{
+ fh("a/a/a", fileA, zip.Deflate),
+ fh("a/a/b", fileB, zip.Deflate),
+ fh("a/a/c", fileC, zip.Deflate),
+ fh("a/a/d", fileB, zip.Deflate),
+ },
+ },
+ {
name: "list",
args: fileArgsBuilder().
List("l"),
@@ -359,6 +380,7 @@ func TestZip(t *testing.T) {
args.AddDirectoryEntriesToZip = test.dirEntries
args.NonDeflatedFiles = test.nonDeflatedFiles
args.ManifestSourcePath = test.manifest
+ args.StoreSymlinks = test.storeSymlinks
args.Filesystem = mockFs
buf := &bytes.Buffer{}