tests: note that znew-k test depends on length of temp file name
authorJim Meyering <meyering@redhat.com>
Mon, 1 Feb 2010 10:09:14 +0000 (11:09 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 3 Feb 2010 05:22:32 +0000 (06:22 +0100)
* tests/znew-k: Tweak diagnostic, factor and add a surprising comment.

tests/znew-k [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 9a334c8..d63ec26
@@ -27,16 +27,20 @@ fi
 
 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
 
-printf '%1012977s' ' ' | gzip -c >znew-k.Z || 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 > $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