From 4b2dd7730a3b771c6509aedd34fdbdb0f699d501 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 26 Sep 2005 23:02:34 +0000
Subject: Test "touch -" too.

---
 tests/touch/empty-file | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'tests/touch/empty-file')

diff --git a/tests/touch/empty-file b/tests/touch/empty-file
index 6e478a97f..c9092b258 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
-- 
cgit v1.2.3-70-g09d2