2 # Demonstrate how mv fails when it tries to move a directory into itself.
4 if test "$VERBOSE" = yes; then
14 rm -rf $dir $file || test_failure=1
15 mkdir -p $dir/a/b || test_failure=1
16 touch $file || test_failure=1
18 if test $test_failure = 1; then
19 echo 'failure in testing framework'
25 # Make sure we get English translations.
26 . $srcdir/../lang-default
28 # This mv command should fail.
29 mv $dir $file $dir > out 2>&1 && fail=1
34 -e "s,$dir/$dir,DEST," \
38 XXX: cannot move `SRC' to a subdirectory of itself, `DEST'
41 cmp out2 exp || fail=1
43 # Make sure the file is gone.
44 test -f $file && fail=1
45 # Make sure the directory is *not* moved.
46 test -d $dir || fail=1
47 test -d $dir/$dir && fail=1
48 # Make sure the file has been moved to the right place.
49 test -f $dir/$file || fail=1
50 rm -rf $dir $file out out2 exp