summaryrefslogtreecommitdiff
path: root/tests/ls
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-12-19 10:21:51 +0000
committerJim Meyering <jim@meyering.net>1999-12-19 10:21:51 +0000
commitc8707dcc2f7d33d664e636c3b69bdc8bc8098327 (patch)
treec4994b6b20dce697c47690202dfaf1b2e6bb51ac /tests/ls
parent4d8a95eff3f66920fc11175532d75f9d013dc313 (diff)
downloadcoreutils-c8707dcc2f7d33d664e636c3b69bdc8bc8098327.tar.xz
.
Diffstat (limited to 'tests/ls')
-rw-r--r--tests/ls/Makefile.in2
-rwxr-xr-xtests/ls/symlink-slash35
2 files changed, 36 insertions, 1 deletions
diff --git a/tests/ls/Makefile.in b/tests/ls/Makefile.in
index dc84407cd..8738c24b5 100644
--- a/tests/ls/Makefile.in
+++ b/tests/ls/Makefile.in
@@ -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
index 000000000..ae12b091b
--- /dev/null
+++ b/tests/ls/symlink-slash
@@ -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