delete trailing whitespace from control files
[debian/gzip] / tests / zdiff
index da753c69bea2c93cb13a5bae728f7a514f31ffea..baa827fb0a1e9c993d98b61d504dd950f5155244 100755 (executable)
@@ -2,7 +2,7 @@
 # Exercise zdiff with two compressed inputs.
 # Before gzip-1.4, this would fail.
 
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 # limit so don't run it by default.
 
-if test "$VERBOSE" = yes; then
-  set -x
-  zdiff --version
-fi
+. "${srcdir=.}/init.sh"; path_prepend_ ..
 
-: ${srcdir=.}
-. "$srcdir/tests/init.sh"; path_prepend_ .
-
-echo a > a || framework_failure
-echo b > b || framework_failure
-gzip a b || framework_failure
+echo a > a || framework_failure_
+echo b > b || framework_failure_
 
 cat <<EOF > exp
 1c1
@@ -37,11 +30,13 @@ cat <<EOF > exp
 > b
 EOF
 
+diff a b | diff exp - || skip_ "diff output format is incompatible with POSIX"
+
 fail=0
-zdiff a.gz b.gz > out 2>&1
-test $? = 1 || fail=1
+gzip a b || fail=1
+returns_ 1 zdiff a.gz b.gz > out 2>&1 || fail=1
 
-compare out exp || fail=1
+compare exp out || fail=1
 
 rm -f out
 # expect success, for equal files