Skip to content

Commit

Permalink
Use prerequisites to skip tests that need unzip
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
  • Loading branch information
Johannes Sixt committed Mar 22, 2009
1 parent 6fd1106 commit 552a26c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions t/t0024-crlf-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ test_expect_success 'tar archive' '
"$UNZIP" -v >/dev/null 2>&1
if [ $? -eq 127 ]; then
say "Skipping ZIP test, because unzip was not found"
test_done
exit
else
test_set_prereq UNZIP
fi

test_expect_success 'zip archive' '
test_expect_success UNZIP 'zip archive' '
git archive --format=zip HEAD >test.zip &&
Expand Down
16 changes: 8 additions & 8 deletions t/t5000-tar-tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,37 +187,37 @@ test_expect_success 'git archive --format=zip with --output' \
$UNZIP -v >/dev/null 2>&1
if [ $? -eq 127 ]; then
say "Skipping ZIP tests, because unzip was not found"
test_done
exit
else
test_set_prereq UNZIP
fi

test_expect_success \
test_expect_success UNZIP \
'extract ZIP archive' \
'(mkdir d && cd d && $UNZIP ../d.zip)'

test_expect_success \
test_expect_success UNZIP \
'validate filenames' \
'(cd d/a && find .) | sort >d.lst &&
test_cmp a.lst d.lst'

test_expect_success \
test_expect_success UNZIP \
'validate file contents' \
'diff -r a d/a'

test_expect_success \
'git archive --format=zip with prefix' \
'git archive --format=zip --prefix=prefix/ HEAD >e.zip'

test_expect_success \
test_expect_success UNZIP \
'extract ZIP archive with prefix' \
'(mkdir e && cd e && $UNZIP ../e.zip)'

test_expect_success \
test_expect_success UNZIP \
'validate filenames with prefix' \
'(cd e/prefix/a && find .) | sort >e.lst &&
test_cmp a.lst e.lst'

test_expect_success \
test_expect_success UNZIP \
'validate file contents with prefix' \
'diff -r a e/prefix/a'

Expand Down

0 comments on commit 552a26c

Please sign in to comment.