--- /dev/null
+#!/bin/sh
+# move a file onto itself with --force
+
+if test "$VERBOSE" = yes; then
+ set -x
+ mv --version
+fi
+
+ff=force-file
+
+framework_failure=0
+rm -f $ff || framework_failure=1
+echo force-contents > $ff || framework_failure=1
+
+if test $framework_failure = 1; then
+ echo 'failure in testing framework'
+ exit 1
+fi
+
+# Make sure we get English translations.
+LANGUAGE=C
+export LANGUAGE
+LC_ALL=C
+export LC_ALL
+LANG=C
+export LANG
+
+# This mv command should exit nonzero.
+mv --force $ff $ff > out 2>&1 && fail=1
+
+cat > exp <<EOF
+mv: \`$ff' and \`$ff' are the same file
+EOF
+
+cmp out exp || fail=1
+test `cat $ff` = force-contents || fail=1
+
+rm -fr out exp $ff
+
+exit $fail