diff options
-rwxr-xr-x | tests/mv/i-3 | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/mv/i-3 b/tests/mv/i-3 index 24e0e737f..62d2c2457 100755 --- a/tests/mv/i-3 +++ b/tests/mv/i-3 @@ -1,5 +1,6 @@ #!/bin/sh -# Make sure `mv file unwritable-file' prompts the user. +# Make sure that `mv file unwritable-file' prompts the user +# and that `mv -f file unwritable-file' doesn't. if test "$VERBOSE" = yes; then set -x @@ -18,8 +19,8 @@ trap '(exit $?); exit' 1 2 13 15 framework_failure=0 mkdir $tmp || framework_failure=1 cd $tmp || framework_failure=1 -touch f g || framework_failure=1 -chmod 0 g || framework_failure=1 +touch f g h i || framework_failure=1 +chmod 0 g i || framework_failure=1 if test $framework_failure = 1; then echo 'failure in testing framework' 1>&2 @@ -30,6 +31,7 @@ fail=0 ls /dev/stdin >/dev/null 2>&1 \ || { (exit 77); exit; } + mv f g < /dev/stdin > out 2>&1 & pid=$! sleep 1 kill $pid @@ -40,4 +42,14 @@ case "`cat out`" in *) fail=1 ;; esac +mv -f h i > out 2>&1 || fail=1 +test -f i || fail=1 +test -f h && fail=1 + +# Make sure there was no prompt. +case "`cat out`" in + '') ;; + *) fail=1 ;; +esac + (exit $fail); exit |