.
authorJim Meyering <jim@meyering.net>
Sun, 19 Dec 1999 10:21:51 +0000 (10:21 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 19 Dec 1999 10:21:51 +0000 (10:21 +0000)
tests/ls/Makefile.in
tests/ls/symlink-slash [new file with mode: 0755]

index dc84407..8738c24 100644 (file)
@@ -103,7 +103,7 @@ l = @l@
 
 AUTOMAKE_OPTIONS = 1.2 gnits
 
-TESTS = rt-1 time-1
+TESTS = rt-1 time-1 slashed-symlink
 EXTRA_DIST = $(TESTS)
 TESTS_ENVIRONMENT = \
   top_srcdir=$(top_srcdir) \
diff --git a/tests/ls/symlink-slash b/tests/ls/symlink-slash
new file mode 100755 (executable)
index 0000000..ae12b09
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Do dereference a symlink arg if its name is written with a trailing slash.
+
+if test "$VERBOSE" = yes; then
+  set -x
+  ls --version
+fi
+
+tmp=t-ls.$$
+
+framework_failure=0
+mkdir $tmp || framework_failure=1
+cd $tmp || framework_failure=1
+
+mkdir dir || framework_failure=1
+ln -s dir symlink || framework_failure=1
+
+if test $framework_failure = 1; then
+  echo 'failure in testing framework'
+  exit 1
+fi
+
+LANGUAGE=C; export LANGUAGE
+LANG=C; export LANG
+
+fail=0
+set `ls -l symlink/`
+
+# Prior to fileutils-4.0k, the following would have output `... symlink -> dir'.
+test "$*" = 'total 0' && : || fail=1
+
+cd ..
+rm -rf $tmp
+
+exit $fail