summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/check.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh
index 27b1a51..6a6ef38 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# check script for Zutils - Utilities dealing with compressed files
-# Copyright (C) 2009-2020 Antonio Diaz Diaz.
+# Copyright (C) 2009-2021 Antonio Diaz Diaz.
#
# This script is free software: you have unlimited permission
# to copy, distribute, and modify it.
@@ -56,6 +56,7 @@ cat in in in in in in > in6 || framework_failure
bad0_lz="${testdir}"/zero_bad_crc.lz
bad0_gz="${testdir}"/zero_bad_crc.gz
bad1_lz="${testdir}"/test_bad_crc.lz
+touch empty empty.bz2 empty.gz empty.lz
fail=0
test_failed() { fail=1 ; printf " $1" ; [ -z "$2" ] || printf "($2)" ; }
@@ -64,6 +65,8 @@ printf "testing zcat-%s..." "$2"
for i in ${extensions}; do
"${ZCAT}" -N in.$i > copy || test_failed $LINENO $i
cmp in copy || test_failed $LINENO $i
+ "${ZCAT}" -N empty.$i in.$i > copy || test_failed $LINENO $i
+ cmp in copy || test_failed $LINENO $i
"${ZCAT}" -N --format=un in.$i > copy || test_failed $LINENO $i
cmp in copy || test_failed $LINENO $i
"${ZCAT}" -N --force-format=$i in.$i > copy || test_failed $LINENO $i
@@ -145,6 +148,7 @@ for i in ${extensions}; do
"${ZCMP}" -N in.$i in --force-format=$i || test_failed $LINENO $i
"${ZCMP}" -N -i 1kB:1000 -n 500 in6 in.$i || test_failed $LINENO $i
"${ZCMP}" -N -i 1KiB:1024 -n 50 in.$i in6 || test_failed $LINENO $i
+ "${ZCMP}" -N empty empty.$i || test_failed $LINENO $i
done
"${ZCMP}" -Nq in in6
@@ -216,6 +220,7 @@ for i in ${extensions}; do
"${ZDIFF}" -N in.$i in > /dev/null || test_failed $LINENO $i
"${ZDIFF}" -N in.$i in --force-format=$i, > /dev/null ||
test_failed $LINENO $i
+ "${ZDIFF}" -N empty empty.$i > /dev/null || test_failed $LINENO $i
done
"${ZDIFF}" -N in in6 > /dev/null
@@ -293,6 +298,7 @@ for i in ${extensions}; do
test_failed $LINENO $i
"${ZGREP}" -N --force-format=$i "GNU" in 2> /dev/null
[ $? = 2 ] || test_failed $LINENO $i
+ "${ZGREP}" -N "nx_pattern" empty.$i && test_failed $LINENO $i
done
"${ZGREP}" -N pin.tar -e "GNU" > /dev/null || test_failed $LINENO
@@ -358,6 +364,7 @@ done
"${ZTEST}" -N -r || test_failed $LINENO
"${ZTEST}" -N -R . || test_failed $LINENO
"${ZTEST}" -N -R || test_failed $LINENO
+"${ZTEST}" -N empty empty.bz2 empty.gz empty.lz || test_failed $LINENO
"${ZTEST}" -Nq in.gz "${bad0_lz}" in.bz2 "${bad1_lz}" in.lz
[ $? = 2 ] || test_failed $LINENO
@@ -532,6 +539,7 @@ rm -f tmp3/a.lz || framework_failure
cd .. || framework_failure
rm -r tmp2 || framework_failure
+rm -f empty empty.bz2 empty.gz empty.lz || framework_failure
if ln -s '.' slink 2> /dev/null ; then
"${ZCAT}" -N -r slink > /dev/null || test_failed $LINENO
"${ZGREP}" -N -r "GNU" slink > /dev/null || test_failed $LINENO