summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-09-20 08:46:48 +0000
committerJim Meyering <jim@meyering.net>2002-09-20 08:46:48 +0000
commit9a8d898e608790e7a749eaba2268b01c1a5d7fc7 (patch)
tree8f1d9b6369b83f16004b4c8bd4e29c5ea87960fd /tests
parentf0693e040c6eba26782035ad9442ed017756f129 (diff)
downloadcoreutils-9a8d898e608790e7a749eaba2268b01c1a5d7fc7.tar.xz
*** empty log message ***
Diffstat (limited to 'tests')
-rwxr-xr-xtests/rmdir/t-slash28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/rmdir/t-slash b/tests/rmdir/t-slash
new file mode 100755
index 000000000..7fa63fb42
--- /dev/null
+++ b/tests/rmdir/t-slash
@@ -0,0 +1,28 @@
+#!/bin/sh
+# make sure rmdir -p works on a directory specified with a trailing slash
+
+if test "$VERBOSE" = yes; then
+ set -x
+ rmdir --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 dir || framework_failure=1
+
+if test $framework_failure = 1; then
+ echo '$0: failure in testing framework' 1>&2
+ (exit 1); exit 1
+fi
+
+fail=0
+
+rmdir -p dir/ || fail=1
+
+(exit $fail); exit $fail