summaryrefslogtreecommitdiff
path: root/tests/mv/childproof
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-09-23 18:08:45 +0000
committerJim Meyering <jim@meyering.net>2001-09-23 18:08:45 +0000
commit44a8a3472557304990706c1b1ff5aa7004ec62c7 (patch)
tree80caa5f22709fd045372bc040da5ca8deaf82a2a /tests/mv/childproof
parentb310d2131dbd881da01e05346058a9ff4f320ce2 (diff)
downloadcoreutils-44a8a3472557304990706c1b1ff5aa7004ec62c7.tar.xz
tighten up the tests
Diffstat (limited to 'tests/mv/childproof')
-rwxr-xr-xtests/mv/childproof25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/mv/childproof b/tests/mv/childproof
index fdd83dc05..2a944f7e6 100755
--- a/tests/mv/childproof
+++ b/tests/mv/childproof
@@ -32,13 +32,25 @@ fi
fail=0
cp a/f b/f c 2> /dev/null && fail=1
+test -f a/f || fail=1
+test -f b/f || fail=1
+test -f c/f || fail=1
+test "`cat c/f`" = a || fail=1
rm -f c/f
# With --backup=numbered, it should succeed
cp --backup=numbered a/f b/f c || fail=1
+test -f a/f || fail=1
+test -f b/f || fail=1
+test -f c/f || fail=1
+test -f c/f.~1~ || fail=1
rm -f c/f*
mv a/f b/f c 2> /dev/null && fail=1
+test -f a/f && fail=1
+test -f b/f || fail=1
+test -f c/f || fail=1
+test "`cat c/f`" = a || fail=1
# Make sure mv still works when moving hard links.
# This is where the same_file test is necessary, and why
@@ -47,5 +59,18 @@ rm -f c/f* b/f
touch a/f
ln a/f b/g
mv a/f b/g c || fail=1
+test -f a/f && fail=1
+test -f b/g && fail=1
+test -f c/f || fail=1
+test -f c/g || fail=1
+
+mkdir aa
+touch a/f b/f b/g
+mv a/f b/f b/g c
+test -f a/f && fail=1 # a/f should have been moved
+test -f b/f || fail=1 # b/f should remain
+test -f b/g && fail=1 # b/g should have been moved
+test -f c/f || fail=1
+test -f c/g || fail=1
(exit $fail); exit