t5003: skip conversion test if unzip -a is unavailable
Alpine Linux's default unzip(1) doesn't support `-a`. Skip those tests on that platform. Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Đoàn Trần Công Danh committed
Mar 25, 2020 at 22:06 UTC
ff0dab331e2740f7e565e1539bd5848657766f6f
1 file changed
+10
-6
t/t5003-archive-zip.sh
+10
-6
@@ -11,6 +11,10 @@ test_lazy_prereq UNZIP_SYMLINKS '
11
test -h symlink
12
'
13
14
+test_lazy_prereq UNZIP_CONVERT '
15
+ "$GIT_UNZIP" -a "$TEST_DIRECTORY"/t5003/infozip-symlinks.zip
16
+'
17
+
18
check_zip() {
19
zipfile=$1.zip
20
listfile=$1.lst
@@ -35,33 +39,33 @@ check_zip() {
39
extracted=${dir_with_prefix}a
40
original=a
41
38
- test_expect_success UNZIP " extract ZIP archive with EOL conversion" '
42
+ test_expect_success UNZIP_CONVERT " extract ZIP archive with EOL conversion" '
43
(mkdir $dir && cd $dir && "$GIT_UNZIP" -a ../$zipfile)
44
'
45
42
- test_expect_success UNZIP " validate that text files are converted" "
46
+ test_expect_success UNZIP_CONVERT " validate that text files are converted" "
47
test_cmp_bin $extracted/text.cr $extracted/text.crlf &&
48
test_cmp_bin $extracted/text.cr $extracted/text.lf
49
"
50
47
- test_expect_success UNZIP " validate that binary files are unchanged" "
51
+ test_expect_success UNZIP_CONVERT " validate that binary files are unchanged" "
52
test_cmp_bin $original/binary.cr $extracted/binary.cr &&
53
test_cmp_bin $original/binary.crlf $extracted/binary.crlf &&
54
test_cmp_bin $original/binary.lf $extracted/binary.lf
55
"
56
53
- test_expect_success UNZIP " validate that diff files are converted" "
57
+ test_expect_success UNZIP_CONVERT " validate that diff files are converted" "
58
test_cmp_bin $extracted/diff.cr $extracted/diff.crlf &&
59
test_cmp_bin $extracted/diff.cr $extracted/diff.lf
60
"
61
58
- test_expect_success UNZIP " validate that -diff files are unchanged" "
62
+ test_expect_success UNZIP_CONVERT " validate that -diff files are unchanged" "
63
test_cmp_bin $original/nodiff.cr $extracted/nodiff.cr &&
64
test_cmp_bin $original/nodiff.crlf $extracted/nodiff.crlf &&
65
test_cmp_bin $original/nodiff.lf $extracted/nodiff.lf
66
"
67
64
- test_expect_success UNZIP " validate that custom diff is unchanged " "
68
+ test_expect_success UNZIP_CONVERT " validate that custom diff is unchanged " "
69
test_cmp_bin $original/custom.cr $extracted/custom.cr &&
70
test_cmp_bin $original/custom.crlf $extracted/custom.crlf &&
71
test_cmp_bin $original/custom.lf $extracted/custom.lf