mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
also test cp
This commit is contained in:
1 parent
4b08f97c49
commit
1fce29ae93
1 file changed
+27
@@ -1,9 +1,11 @@
|
||||
#!/bin/sh
|
||||
# Ensure that moving hard-linked arguments onto existing destinations works.
|
||||
# Likewise when using cp --preserve=link.
|
||||
|
||||
if test "$VERBOSE" = yes; then
|
||||
set -x
|
||||
mv --version
|
||||
cp --version
|
||||
fi
|
||||
|
||||
. $srcdir/../envvar-check
|
||||
@@ -30,6 +32,31 @@ fi
|
||||
|
||||
fail=0
|
||||
|
||||
# ======================================
|
||||
cp --preserve=link a b c dst || fail=1
|
||||
# The source files must remain.
|
||||
test -f a || fail=1
|
||||
test -f b || fail=1
|
||||
test -f c || fail=1
|
||||
cd dst
|
||||
|
||||
# Three destination files must exist.
|
||||
test -f a || fail=1
|
||||
test -f b || fail=1
|
||||
test -f c || fail=1
|
||||
|
||||
# The three i-node numbers must be the same.
|
||||
ia=`ls -i a|sed 's/ a//'`
|
||||
ib=`ls -i b|sed 's/ b//'`
|
||||
ic=`ls -i c|sed 's/ c//'`
|
||||
test $ia = $ib || fail=1
|
||||
test $ia = $ic || fail=1
|
||||
|
||||
cd ..
|
||||
rm -f dst/[abc]
|
||||
(cd dst && touch a b c)
|
||||
|
||||
# ======================================
|
||||
mv a b c dst || fail=1
|
||||
|
||||
# The source files must be gone.
|
||||
|
||||
Reference in new issue
Block a user