From: Paul Eggert Date: Mon, 26 Sep 2005 23:02:34 +0000 (+0000) Subject: Test "touch -" too. X-Git-Tag: v5.90~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b2dd7730a3b771c6509aedd34fdbdb0f699d501;p=thirdparty%2Fcoreutils.git Test "touch -" too. --- diff --git a/tests/touch/empty-file b/tests/touch/empty-file index 6e478a97f8..c9092b2589 100755 --- a/tests/touch/empty-file +++ b/tests/touch/empty-file @@ -22,11 +22,13 @@ fail=0 framework_failure=0 for d in $TOUCH_DIR_LIST; do - rm -rf $d/a $d/b + rm -rf $d/a $d/b $d/c > $d/a || framework_failure=1 test -f $d/a || framework_failure=1 > $d/b || framework_failure=1 test -f $d/b || framework_failure=1 + > $d/c || framework_failure=1 + test -f $d/c || framework_failure=1 done if test $framework_failure = 1; then @@ -49,7 +51,12 @@ for d in $TOUCH_DIR_LIST; do set x `ls -t $d/a $d/b` test "$*" = "x $d/b $d/a" || fail=1 - rm -rf $d/a $d/b + if touch - 1< $d/c 2> /dev/null; then + set x `ls -t $d/a $d/c` + test "$*" = "x $d/c $d/a" || fail=1 + fi + + rm -rf $d/a $d/b $d/c done if test $fail != 0; then diff --git a/tests/touch/no-create-missing b/tests/touch/no-create-missing index d752574206..1faebc81de 100755 --- a/tests/touch/no-create-missing +++ b/tests/touch/no-create-missing @@ -25,5 +25,8 @@ fail=0 touch -c no-file > /dev/null 2>&1 || fail=1 touch -cm no-file > /dev/null 2>&1 || fail=1 touch -ca no-file > /dev/null 2>&1 || fail=1 +touch -c - >&- 2> /dev/null || fail=1 +touch -cm - >&- 2> /dev/null || fail=1 +touch -ca - >&- 2> /dev/null || fail=1 (exit $fail); exit $fail diff --git a/tests/touch/read-only b/tests/touch/read-only index 109ab00b1d..11516d3c85 100755 --- a/tests/touch/read-only +++ b/tests/touch/read-only @@ -29,4 +29,6 @@ fail=0 touch read-only || fail=1 +touch - 1< read-only 2> /dev/null && { test ! -f - || fail=1; } + (exit $fail); exit $fail