cp: improve test coverage
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
d084cb9dc7
commit
1e9bc2603d
@ -24,11 +24,11 @@ ln -s dir cp.testdir/dir_symlink
|
|||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp" '\
|
testing "cp" '\
|
||||||
cd cp.testdir || exit 1; cp * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -e cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test ! -e dir || echo BAD: dir
|
||||||
test ! -e cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test ! -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
|
||||||
' "\
|
' "\
|
||||||
cp: omitting directory ${sq}dir'
|
cp: omitting directory ${sq}dir'
|
||||||
cp: omitting directory ${sq}dir_symlink'
|
cp: omitting directory ${sq}dir_symlink'
|
||||||
@ -37,11 +37,11 @@ cp: omitting directory ${sq}dir_symlink'
|
|||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp -d" '\
|
testing "cp -d" '\
|
||||||
cd cp.testdir || exit 1; cp -d * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -d * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -e cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test ! -e dir || echo BAD: dir
|
||||||
test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
|
||||||
' "\
|
' "\
|
||||||
cp: omitting directory ${sq}dir'
|
cp: omitting directory ${sq}dir'
|
||||||
1
|
1
|
||||||
@ -49,11 +49,11 @@ cp: omitting directory ${sq}dir'
|
|||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp -P" '\
|
testing "cp -P" '\
|
||||||
cd cp.testdir || exit 1; cp -P * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -P * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -e cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test ! -e dir || echo BAD: dir
|
||||||
test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
|
||||||
' "\
|
' "\
|
||||||
cp: omitting directory ${sq}dir'
|
cp: omitting directory ${sq}dir'
|
||||||
1
|
1
|
||||||
@ -61,11 +61,11 @@ cp: omitting directory ${sq}dir'
|
|||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp -L" '\
|
testing "cp -L" '\
|
||||||
cd cp.testdir || exit 1; cp -L * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -L * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -e cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test ! -e dir || echo BAD: dir
|
||||||
test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test ! -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
|
||||||
' "\
|
' "\
|
||||||
cp: omitting directory ${sq}dir'
|
cp: omitting directory ${sq}dir'
|
||||||
cp: omitting directory ${sq}dir_symlink'
|
cp: omitting directory ${sq}dir_symlink'
|
||||||
@ -74,11 +74,11 @@ cp: omitting directory ${sq}dir_symlink'
|
|||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp -H" '\
|
testing "cp -H" '\
|
||||||
cd cp.testdir || exit 1; cp -H * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -H * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -e cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test ! -e dir || echo BAD: dir
|
||||||
test ! -e cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test ! -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
|
||||||
' "\
|
' "\
|
||||||
cp: omitting directory ${sq}dir'
|
cp: omitting directory ${sq}dir'
|
||||||
cp: omitting directory ${sq}dir_symlink'
|
cp: omitting directory ${sq}dir_symlink'
|
||||||
@ -87,52 +87,52 @@ cp: omitting directory ${sq}dir_symlink'
|
|||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp -R" '\
|
testing "cp -R" '\
|
||||||
cd cp.testdir || exit 1; cp -R * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -R * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -L cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test -d dir || echo BAD: dir
|
||||||
test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
|
||||||
test ! -L cp.testdir2/dir/file || echo BAD: dir/file
|
test ! -L dir/file && test -f dir/file || echo BAD: dir/file
|
||||||
test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink
|
test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
|
||||||
' "\
|
' "\
|
||||||
0
|
0
|
||||||
" "" ""
|
" "" ""
|
||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp -Rd" '\
|
testing "cp -Rd" '\
|
||||||
cd cp.testdir || exit 1; cp -Rd * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -Rd * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -L cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test -d dir || echo BAD: dir
|
||||||
test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
|
||||||
test ! -L cp.testdir2/dir/file || echo BAD: dir/file
|
test ! -L dir/file && test -f dir/file || echo BAD: dir/file
|
||||||
test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink
|
test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
|
||||||
' "\
|
' "\
|
||||||
0
|
0
|
||||||
" "" ""
|
" "" ""
|
||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp -RP" '\
|
testing "cp -RP" '\
|
||||||
cd cp.testdir || exit 1; cp -RP * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -RP * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -L cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test -d dir || echo BAD: dir
|
||||||
test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
|
||||||
test ! -L cp.testdir2/dir/file || echo BAD: dir/file
|
test ! -L dir/file && test -f dir/file || echo BAD: dir/file
|
||||||
test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink
|
test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
|
||||||
' "\
|
' "\
|
||||||
0
|
0
|
||||||
" "" ""
|
" "" ""
|
||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp -RL" '\
|
testing "cp -RL" '\
|
||||||
cd cp.testdir || exit 1; cp -RL * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -RL * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -L cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test -d dir || echo BAD: dir
|
||||||
test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
|
||||||
test ! -L cp.testdir2/dir/file || echo BAD: dir/file
|
test ! -L dir/file && test -f dir/file || echo BAD: dir/file
|
||||||
test ! -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink
|
test ! -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
|
||||||
' "\
|
' "\
|
||||||
0
|
0
|
||||||
" "" ""
|
" "" ""
|
||||||
@ -142,13 +142,13 @@ rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
|||||||
# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir'
|
# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir'
|
||||||
test x"$SKIP_KNOWN_BUGS" = x"" && \
|
test x"$SKIP_KNOWN_BUGS" = x"" && \
|
||||||
testing "cp -RH" '\
|
testing "cp -RH" '\
|
||||||
cd cp.testdir || exit 1; cp -RH * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -RH * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -L cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test -d dir || echo BAD: dir
|
||||||
test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
|
||||||
test ! -L cp.testdir2/dir/file || echo BAD: dir/file
|
test ! -L dir/file && test -f dir/file || echo BAD: dir/file
|
||||||
test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink
|
test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
|
||||||
' "\
|
' "\
|
||||||
0
|
0
|
||||||
" "" ""
|
" "" ""
|
||||||
@ -158,26 +158,26 @@ rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
|||||||
# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir'
|
# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir'
|
||||||
test x"$SKIP_KNOWN_BUGS" = x"" && \
|
test x"$SKIP_KNOWN_BUGS" = x"" && \
|
||||||
testing "cp -RHP" '\
|
testing "cp -RHP" '\
|
||||||
cd cp.testdir || exit 1; cp -RHP * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -RHP * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -L cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test -d dir || echo BAD: dir
|
||||||
test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
|
||||||
test ! -L cp.testdir2/dir/file || echo BAD: dir/file
|
test ! -L dir/file && test -f dir/file || echo BAD: dir/file
|
||||||
test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink
|
test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
|
||||||
' "\
|
' "\
|
||||||
0
|
0
|
||||||
" "" ""
|
" "" ""
|
||||||
|
|
||||||
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
||||||
testing "cp -RHL" '\
|
testing "cp -RHL" '\
|
||||||
cd cp.testdir || exit 1; cp -RHL * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -RHL * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -L cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test -d dir || echo BAD: dir
|
||||||
test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
|
||||||
test ! -L cp.testdir2/dir/file || echo BAD: dir/file
|
test ! -L dir/file && test -f dir/file || echo BAD: dir/file
|
||||||
test ! -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink
|
test ! -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
|
||||||
' "\
|
' "\
|
||||||
0
|
0
|
||||||
" "" ""
|
" "" ""
|
||||||
@ -188,13 +188,13 @@ rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
|
|||||||
# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir'
|
# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir'
|
||||||
test x"$SKIP_KNOWN_BUGS" = x"" && \
|
test x"$SKIP_KNOWN_BUGS" = x"" && \
|
||||||
testing "cp -RLH" '\
|
testing "cp -RLH" '\
|
||||||
cd cp.testdir || exit 1; cp -RLH * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1
|
cd cp.testdir || exit 1; cp -RLH * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
|
||||||
test ! -L cp.testdir2/file || echo BAD: file
|
test ! -L file && test -f file || echo BAD: file
|
||||||
test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink
|
test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
|
||||||
test ! -L cp.testdir2/dir || echo BAD: dir
|
test ! -L dir && test -d dir || echo BAD: dir
|
||||||
test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink
|
test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
|
||||||
test ! -L cp.testdir2/dir/file || echo BAD: dir/file
|
test ! -L dir/file && test -f dir/file || echo BAD: dir/file
|
||||||
test ! -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink
|
test ! -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
|
||||||
' "\
|
' "\
|
||||||
0
|
0
|
||||||
" "" ""
|
" "" ""
|
||||||
|
Loading…
Reference in New Issue
Block a user