*** empty log message ***
authorJim Meyering <jim@meyering.net>
Sun, 23 May 1999 13:36:37 +0000 (13:36 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 23 May 1999 13:36:37 +0000 (13:36 +0000)
tests/mv/force [new file with mode: 0755]

diff --git a/tests/mv/force b/tests/mv/force
new file mode 100755 (executable)
index 0000000..407a482
--- /dev/null
@@ -0,0 +1,40 @@
+#!/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