From e082e26ce05fe94c7a4df87b73019e5305f3e438 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 24 Oct 2005 13:42:02 +0000 Subject: New test, for "mkdir -p" failure. --- tests/mkdir/p-slashdot | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 tests/mkdir/p-slashdot (limited to 'tests') diff --git a/tests/mkdir/p-slashdot b/tests/mkdir/p-slashdot new file mode 100755 index 000000000..de99c5cd5 --- /dev/null +++ b/tests/mkdir/p-slashdot @@ -0,0 +1,31 @@ +#!/bin/sh +# Ensure that mkdir -p works with arguments specified with a trailing "/.". + +if test "$VERBOSE" = yes; then + set -x + mkdir --version +fi + +pwd=`pwd` +tmp=`echo "$0"|sed 's,.*/,,'`.tmp +trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +if test $framework_failure = 1; then + echo 'failure in testing framework' + (exit 1); exit 1 +fi + +fail=0 + +mkdir -p d1/. || fail=1 +test -d d1 || fail=1 + +mkdir -p d2/.. || fail=1 +test -d d2 || fail=1 + +(exit $fail); exit $fail -- cgit v1.2.3-70-g09d2