diff options
author | Jim Meyering <jim@meyering.net> | 1999-10-17 21:24:26 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-10-17 21:24:26 +0000 |
commit | 23d5af772ebb4c459f4bbf93bad0af2331484ba5 (patch) | |
tree | cdfd3ae1aceba75ad9ba8ec049966a47de22aa1b /tests/cp | |
parent | 8bbc2e29372879f7b32d8c72185c8a8d1d091fb3 (diff) | |
download | coreutils-23d5af772ebb4c459f4bbf93bad0af2331484ba5.tar.xz |
adapt to work for mv, too
Diffstat (limited to 'tests/cp')
-rwxr-xr-x | tests/cp/cp-mv-backup | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/cp/cp-mv-backup b/tests/cp/cp-mv-backup index 8750d614a..34512c01d 100755 --- a/tests/cp/cp-mv-backup +++ b/tests/cp/cp-mv-backup @@ -1,6 +1,5 @@ #!/bin/sh -# Test basic --backup functionality -- initially do it just for cp. -# It won't be hard to adapt this script to work for mv, too. +# Test basic --backup functionality for both cp and mv. if test "$VERBOSE" = yes; then set -x @@ -37,15 +36,17 @@ fi exec 1> $actual fail=0 -for initial_files in 'a' 'a b' 'a b b~' 'a b b.~1~' 'a b b~ b.~1~'; do - for opt in none off numbered t existing nil simple never; do - ( cd $dir; touch $initial_files ) - cp --backup=$opt $dir/a $dir/b || fail=1 - ( cd $dir; echo $initial_files $opt: `ls a b*`; rm -f a b b~ b.~?~ ) +for prog in cp mv; do + for initial_files in 'a' 'a b' 'a b b~' 'a b b.~1~' 'a b b~ b.~1~'; do + for opt in none off numbered t existing nil simple never; do + ( cd $dir; touch $initial_files ) + $prog --backup=$opt $dir/a $dir/b || fail=1 + ( cd $dir; echo $initial_files $opt: `ls`; rm -f a b b~ b.~?~ ) + done done done -cat <<\EOF > $expected +cat <<\EOF > $expected-tmp a none: a b a off: a b a numbered: a b @@ -88,6 +89,8 @@ a b b~ b.~1~ simple: a b b.~1~ b~ a b b~ b.~1~ never: a b b.~1~ b~ EOF +sed 's/: a/:/' $expected-tmp |cat $expected-tmp - > $expected + # Uncomment this if you see a failure and want to try to diagnose it. # diff -u $expected $actual 1>&2 |