1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
package getter
import (
"path/filepath"
"testing"
"time"
)
func TestTar(t *testing.T) {
mtime := time.Unix(0, 0)
cases := []TestDecompressCase{
{
"extended_header.tar",
true,
false,
[]string{"directory/", "directory/a", "directory/b"},
"",
nil,
},
{
"implied_dir.tar",
true,
false,
[]string{"directory/", "directory/sub/", "directory/sub/a", "directory/sub/b"},
"",
nil,
},
{
"unix_time_0.tar",
true,
false,
[]string{"directory/", "directory/sub/", "directory/sub/a", "directory/sub/b"},
"",
&mtime,
},
}
for i, tc := range cases {
cases[i].Input = filepath.Join("./test-fixtures", "decompress-tar", tc.Input)
}
TestDecompressor(t, new(tarDecompressor), cases)
}
|