summaryrefslogtreecommitdiff
path: root/tests/md5sum/newline-1
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-07 16:06:33 +0000
committerJim Meyering <jim@meyering.net>1999-03-07 16:06:33 +0000
commit23b14f50e346c7da08ea27b364aea740c5f71bdd (patch)
tree629ef81b36f867d0ff30abf29f469791f13e50eb /tests/md5sum/newline-1
parentb9842e7300da0100e21c2236514e5f03a2587540 (diff)
downloadcoreutils-23b14f50e346c7da08ea27b364aea740c5f71bdd.tar.xz
Test for the actual feature.
With help from Eli Zaretskii.
Diffstat (limited to 'tests/md5sum/newline-1')
-rwxr-xr-xtests/md5sum/newline-119
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/md5sum/newline-1 b/tests/md5sum/newline-1
index 818e9fcfe..4ff544b74 100755
--- a/tests/md5sum/newline-1
+++ b/tests/md5sum/newline-1
@@ -5,14 +5,25 @@
case "$PERL" in
*'missing perl')
- echo 1>&2 "$0: configure didn't find a usable version of Perl, so can't run this test"
+ echo 1>&2 "$0: configure didn't find a usable version of Perl," \
+ " so can't run this test"
exit 77
;;
esac
-if test -n "$COMSPEC$ComSpec"; then
- # DOS/Windows
- echo 1>&2 "$0: This test would always fail on MSDOS/Window systems"
+# See if we can create a filename that contains a newline.
+# Be careful to do it in a subshell so that we can redirect the
+# error output if it fails.
+(> 'a
+b') 2> /dev/null \
+ && filename_may_contain_newline=yes \
+ || filename_may_contain_newline=no
+rm -f 'a
+b'
+
+if test $filename_may_contain_newline = no; then
+ echo 1>&2 "$0: can't create newline-containing file name," \
+ "so can't run this test"
exit 77
fi