diff options
author | Jim Meyering <jim@meyering.net> | 2005-05-10 07:25:24 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-05-10 07:25:24 +0000 |
commit | 208bacc4b7eb949d56b507d6beae679361ac6cbc (patch) | |
tree | f5eefcec9338ab7c3b1bf18af9bba769c3d20998 /tests | |
parent | 7bbaee80e27c18c0f5ee0f32afd11db66f08683b (diff) | |
download | coreutils-208bacc4b7eb949d56b507d6beae679361ac6cbc.tar.xz |
*** empty log message ***
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/mv/reply-no | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/mv/reply-no b/tests/mv/reply-no new file mode 100755 index 000000000..337545f75 --- /dev/null +++ b/tests/mv/reply-no @@ -0,0 +1,37 @@ +#!/bin/sh +# Ensure that `mv --reply=no f1 f2' works. + +if test "$VERBOSE" = yes; then + set -x + mv --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 +touch a b || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +mv --interactive --reply=no a b > out 2>&1 || fail=1 + +# Both files must remain. +test -f a || fail=1 +test -f b || fail=1 + +# Expect no output. +touch exp +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail |