summaryrefslogtreecommitdiff
path: root/tests/du/deref-args
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-09-19 08:27:29 +0000
committerJim Meyering <jim@meyering.net>2003-09-19 08:27:29 +0000
commit567e58cd2dd50d9c7b09226b486f437250bf84b7 (patch)
treedcac31e5df37ca74441618efb86a86e263a56b6f /tests/du/deref-args
parent8f51c46818600b35a8cb4b756e7538629ad0866c (diff)
downloadcoreutils-567e58cd2dd50d9c7b09226b486f437250bf84b7.tar.xz
*** empty log message ***
Diffstat (limited to 'tests/du/deref-args')
-rwxr-xr-xtests/du/deref-args36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/du/deref-args b/tests/du/deref-args
new file mode 100755
index 000000000..c3cbaed9d
--- /dev/null
+++ b/tests/du/deref-args
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Ensure that --dereference-args (-D) gives reasonable names.
+# This test would fail for coreutils-5.0.91.
+
+if test "$VERBOSE" = yes; then
+ set -x
+ du --version
+fi
+
+pwd=`pwd`
+t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
+trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap '(exit $?); exit $?' 1 2 13 15
+
+framework_failure=0
+mkdir -p $tmp || framework_failure=1
+cd $tmp || framework_failure=1
+mkdir -p dir/a/b
+ln -s dir slink
+
+if test $framework_failure = 1; then
+ echo "$0: failure in testing framework" 1>&2
+ (exit 1); exit 1
+fi
+
+fail=0
+
+du -D slink | sed 's/^[0-9][0-9]* //' > out
+cat <<\EOF > exp
+slink
+EOF
+
+cmp out exp || fail=1
+test $fail = 1 && diff out exp 2> /dev/null
+
+(exit $fail); exit $fail