summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:52:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:52:47 +0000
commit274c86b0397198011756479218dd14262d9421ff (patch)
tree47cd5cedf3cfcbba77d127200852a21d03502e7c /testsuite
parentReleasing debian version 1.11-5. (diff)
downloadzutils-274c86b0397198011756479218dd14262d9421ff.tar.xz
zutils-274c86b0397198011756479218dd14262d9421ff.zip
Merging upstream version 1.12~pre2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/check.sh42
1 files changed, 37 insertions, 5 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh
index b97abd7..5ad9d5b 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -321,6 +321,8 @@ done
test_failed $LINENO
"${ZGREP}" -N -l "GNU" in in.gz in.bz2 in.lz -- -in- > /dev/null ||
test_failed $LINENO
+"${ZGREP}" -N -l -Z "GNU" in in.gz in.bz2 in.lz -- -in- > /dev/null ||
+ test_failed $LINENO
"${ZGREP}" -N -L "GNU" in in.gz in.bz2 in.lz -- -in- || test_failed $LINENO
"${ZGREP}" -N -l "nx_pattern" in in.gz in.bz2 in.lz -- -in- &&
test_failed $LINENO
@@ -402,15 +404,15 @@ cat in.gz > a.gz || framework_failure
"${ZUPDATE}" -N --gz='gzip --bad-option' a.gz 2> /dev/null
[ $? = 1 ] || test_failed $LINENO
"${ZUPDATE}" -Nq --lz=bad_command a.gz
-[ $? = 1 ] || test_failed $LINENO
+[ $? = 2 ] || test_failed $LINENO
"${ZUPDATE}" -N --lz='lzip --bad-option' a.gz 2> /dev/null
-[ $? = 1 ] || test_failed $LINENO
+[ $? = 2 ] || test_failed $LINENO
"${ZUPDATE}" -N --bad-option 2> /dev/null
-[ $? = 1 ] || test_failed $LINENO
+[ $? = 2 ] || test_failed $LINENO
cat in.lz in.lz > a.lz || framework_failure
"${ZUPDATE}" -Nq -f a.bz2 a.gz
-[ $? = 1 ] || test_failed $LINENO
+[ $? = 2 ] || test_failed $LINENO
[ -e a.bz2 ] || test_failed $LINENO
[ -e a.gz ] || test_failed $LINENO
[ -e a.lz ] || test_failed $LINENO
@@ -471,10 +473,30 @@ cat in.gz > c.tgz || framework_failure
[ -e c.tlz ] || test_failed $LINENO
rm -f a.tlz b.tlz c.tlz || framework_failure
+cat in.bz2 > a.tbz || framework_failure # expand combined extensions
+cat in.bz2 > b.tbz2 || framework_failure
+cat in.gz > c.tgz || framework_failure
+"${ZUPDATE}" -N -e a.tbz b.tbz2 c.tgz || test_failed $LINENO
+[ ! -e a.tbz ] || test_failed $LINENO
+[ ! -e b.tbz2 ] || test_failed $LINENO
+[ ! -e c.tgz ] || test_failed $LINENO
+[ ! -e a ] || test_failed $LINENO
+[ ! -e b ] || test_failed $LINENO
+[ ! -e c ] || test_failed $LINENO
+[ -e a.tar.lz ] || test_failed $LINENO
+[ -e b.tar.lz ] || test_failed $LINENO
+[ -e c.tar.lz ] || test_failed $LINENO
+[ ! -e a.tlz ] || test_failed $LINENO
+[ ! -e b.tlz ] || test_failed $LINENO
+[ ! -e c.tlz ] || test_failed $LINENO
+rm -f a.tar.lz b.tar.lz c.tar.lz || framework_failure
+
+# test decompression error
cat in.bz2 > a.bz2 || framework_failure
cat "${bad0_gz}" > b.gz || framework_failure
cat in.gz > c.gz || framework_failure
-"${ZUPDATE}" -N -f a.bz2 b.gz c.gz 2> /dev/null && test_failed $LINENO
+"${ZUPDATE}" -N -f a.bz2 b.gz c.gz 2> /dev/null
+[ $? = 1 ] || test_failed $LINENO
[ ! -e a.bz2 ] || test_failed $LINENO
[ -e b.gz ] || test_failed $LINENO
[ -e c.gz ] || test_failed $LINENO
@@ -482,6 +504,16 @@ cat in.gz > c.gz || framework_failure
[ ! -e b ] || test_failed $LINENO
[ ! -e c ] || test_failed $LINENO
[ -e a.lz ] || test_failed $LINENO
+# ignore error
+cat in.bz2 > a.bz2 || framework_failure
+cat "${bad0_gz}" > b.gz || framework_failure
+cat in.gz > c.gz || framework_failure
+"${ZUPDATE}" -N -f -i a.bz2 b.gz c.gz 2> /dev/null
+[ $? = 1 ] || test_failed $LINENO
+[ ! -e a.bz2 ] || test_failed $LINENO
+[ -e b.gz ] || test_failed $LINENO
+[ ! -e c.gz ] || test_failed $LINENO
+[ -e a.lz ] || test_failed $LINENO
rm -f a.lz b.gz c.gz || framework_failure
cat in.bz2 > a.bz2 || framework_failure