maint: update .gitignore files
[debian/gzip] / tests / znew-k
index 9a334c8a3ba4b832cdf9d1ef0155be4b3bf5d468..71b34ec2948e5a90c03a7f261cbaefda9c65e828 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Check that znew -K works without compress(1).
 
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2010-2014 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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # limit so don't run it by default.
 
-if test "$VERBOSE" = yes; then
-  set -x
-  gzip --version
-fi
+. "${srcdir=.}/init.sh"; path_prepend_ ..
 
-: ${srcdir=.}
-. "$srcdir/tests/init.sh"; path_prepend_ "`pwd`"
-
-cat <<'EOF' >compress || framework_failure
+cat <<'EOF' >compress || framework_failure_
 #!/bin/sh
-echo >&2 'compress have been called'
+echo >&2 'compress has been invoked'
 exit 1
 EOF
-chmod +x compress || framework_failure
+chmod +x compress || framework_failure_
+
+# Note that the basename must have a length of 6 or greater.
+# Otherwise, "test -f $name" below would fail.
+name=123456.Z
 
-printf '%1012977s' ' ' | gzip -c >znew-k.Z || framework_failure
+printf '%1012977s' ' ' | gzip -c > $name || framework_failure_
 
 fail=0
 
-znew -K znew-k.Z || fail=1
-test -f znew-k.Z || fail=1
+znew -K $name || fail=1
+test -f $name || fail=1
 
 Exit $fail