mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-02-11 09:51:56 +02:00
tests: adjust \`...' quoting to '...' to adapt to latest gnulib
Run this:
git grep -l "\\\\\`[^']*'" tests \
|xargs perl -pi -e 's/\\\`(.*?'\'')/'\''$1/g
This commit is contained in:
@@ -46,7 +46,7 @@ sed "s/^$prog: cannot read directory /$prog: /" out > t && mv t out
|
||||
sed 's,d/no-x/y,d/no-x,' out > t && mv t out
|
||||
|
||||
cat <<EOF > exp
|
||||
$prog: \`d/no-x': Permission denied
|
||||
$prog: 'd/no-x': Permission denied
|
||||
EOF
|
||||
|
||||
compare exp out || fail=1
|
||||
|
||||
@@ -33,7 +33,7 @@ chmod -c g=rwx $file > empty || fail=1
|
||||
|
||||
test -s empty && fail=1
|
||||
case "`cat out`" in
|
||||
"mode of \`f' changed from 0744 "?rwxr--r--?" to 0774 "?rwxrwxr--?) ;;
|
||||
"mode of 'f' changed from 0744 "?rwxr--r--?" to 0774 "?rwxrwxr--?) ;;
|
||||
*) cat out; fail=1 ;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ for mode in =x =xX =Xx =x,=X =X,=x; do
|
||||
chmod a=r,$mode $file || fail=1
|
||||
case "`ls -l $file`" in
|
||||
---x--x---*) ;;
|
||||
*) fail=1; echo "after \`chmod $mode $file':"; ls -l $file ;;
|
||||
*) fail=1; echo "after 'chmod $mode $file':"; ls -l $file ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ sed "s/^$prog: cannot read directory /$prog: /" out > t && mv t out
|
||||
sed 's,d/no-x/y,d/no-x,' out > t && mv t out
|
||||
|
||||
cat <<EOF > exp
|
||||
$prog: \`d/no-x': Permission denied
|
||||
$prog: 'd/no-x': Permission denied
|
||||
EOF
|
||||
|
||||
compare exp out || fail=1
|
||||
|
||||
@@ -25,7 +25,7 @@ ln -s non-existent dangle || framework_failure_
|
||||
# This operation cannot succeed since the symbolic link dangles.
|
||||
chmod 644 dangle 2> out && fail=1
|
||||
|
||||
echo "chmod: cannot operate on dangling symlink \`dangle'" > exp
|
||||
echo "chmod: cannot operate on dangling symlink 'dangle'" > exp
|
||||
compare exp out || fail=1
|
||||
|
||||
Exit $fail
|
||||
|
||||
@@ -30,12 +30,12 @@ set _ `ls -n f`; shift; test "$3:$4" = 0:1 || fail=1
|
||||
# Make sure the correct diagnostic is output
|
||||
# Note we output a name even though an id was specified.
|
||||
chown -v --from=42 43 f > out || fail=1
|
||||
printf "ownership of \`f' retained as `id -nu`\n" > exp
|
||||
printf "ownership of 'f' retained as `id -nu`\n" > exp
|
||||
compare exp out || fail=1
|
||||
|
||||
# Ensure diagnostics work for non existent files.
|
||||
chown -v 0 nf > out && fail=1
|
||||
printf "failed to change ownership of \`nf' to 0\n" > exp
|
||||
printf "failed to change ownership of 'nf' to 0\n" > exp
|
||||
compare exp out || fail=1
|
||||
|
||||
chown --from=0:1 2:010 f || fail=1
|
||||
|
||||
@@ -23,7 +23,7 @@ mkdir a b c || framework_failure_
|
||||
ln -s ../t a/1 || framework_failure_
|
||||
echo payload > b/1 || framework_failure_
|
||||
|
||||
echo "cp: will not copy \`b/1' through just-created symlink \`c/1'" \
|
||||
echo "cp: will not copy 'b/1' through just-created symlink 'c/1'" \
|
||||
> exp || framework_failure_
|
||||
|
||||
# Check both cases: a dangling symlink, and one pointing to a writable file.
|
||||
|
||||
@@ -28,7 +28,7 @@ echo n | cp -iR a b 2>/dev/null || fail=1
|
||||
|
||||
# test miscellaneous combinations of -f -i -n parameters
|
||||
touch c d || framework_failure_
|
||||
echo "\`c' -> \`d'" > out_copy
|
||||
echo "'c' -> 'd'" > out_copy
|
||||
> out_empty
|
||||
|
||||
# ask for overwrite, answer no
|
||||
|
||||
@@ -22,7 +22,7 @@ print_ver_ cp
|
||||
ln -s no-such dangle || framework_failure_
|
||||
echo hi > f || framework_failure_
|
||||
echo hi > exp || framework_failure_
|
||||
echo "cp: not writing through dangling symlink \`dangle'" \
|
||||
echo "cp: not writing through dangling symlink 'dangle'" \
|
||||
> exp-err || framework_failure_
|
||||
|
||||
|
||||
|
||||
@@ -43,14 +43,14 @@ DEV_OFLOW=$(expr $dev_size + 1)
|
||||
|
||||
timeout 10 dd bs=1 skip=$DEV_OFLOW count=0 status=noxfer < "$device" 2> err
|
||||
test "$?" = "1" || fail=1
|
||||
echo "dd: \`standard input': cannot skip: Invalid argument
|
||||
echo "dd: 'standard input': cannot skip: Invalid argument
|
||||
0+0 records in
|
||||
0+0 records out" > err_ok || framework_failure_
|
||||
compare err_ok err || fail=1
|
||||
|
||||
timeout 10 dd bs=1 seek=$DEV_OFLOW count=0 status=noxfer > "$device" 2> err
|
||||
test "$?" = "1" || fail=1
|
||||
echo "dd: \`standard output': cannot seek: Invalid argument
|
||||
echo "dd: 'standard output': cannot seek: Invalid argument
|
||||
0+0 records in
|
||||
0+0 records out" > err_ok || framework_failure_
|
||||
compare err_ok err || fail=1
|
||||
|
||||
@@ -25,7 +25,7 @@ eval $(getlimits) # for OFF_T limits
|
||||
printf "1234" > file || framework_failure_
|
||||
|
||||
echo "\
|
||||
dd: \`standard input': cannot skip to specified offset
|
||||
dd: 'standard input': cannot skip to specified offset
|
||||
0+0 records in
|
||||
0+0 records out" > skip_err || framework_failure_
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ sed "s/^$prog: cannot read directory /$prog: /" out > t && mv t out
|
||||
sed 's,d/no-x/y,d/no-x,' out > t && mv t out
|
||||
|
||||
cat <<EOF > exp
|
||||
$prog: \`d/no-x': Permission denied
|
||||
$prog: 'd/no-x': Permission denied
|
||||
EOF
|
||||
|
||||
compare exp out || fail=1
|
||||
|
||||
@@ -27,7 +27,7 @@ require_local_dir_
|
||||
if df --type=xfs . >/dev/null 2>&1; then
|
||||
# At least on Irix-6.5.19, when using an xfs file system,
|
||||
# each created symlink (name lengths up to 255) would have a size of `0'.
|
||||
skip_ "\`.' is on an XFS file system"
|
||||
skip_ "'.' is on an XFS file system"
|
||||
fi
|
||||
|
||||
symlink_name_lengths='1 15 16 31 32 59 60 63 64 127 128 255 256 511 512 1024'
|
||||
|
||||
@@ -21,7 +21,7 @@ print_ver_ id
|
||||
|
||||
require_gnu_
|
||||
|
||||
sush - true || skip_ "the \`sush' command does not work"
|
||||
sush - true || skip_ "the 'sush' command does not work"
|
||||
|
||||
# Run `id' with zero UIDs. It should exit with a non-zero status.
|
||||
sush - id > out && fail=1
|
||||
|
||||
@@ -191,13 +191,13 @@ uid_is_privileged_()
|
||||
{
|
||||
# Make sure id -u succeeds.
|
||||
my_uid=$(id -u) \
|
||||
|| { echo "$0: cannot run \`id -u'" 1>&2; return 1; }
|
||||
|| { echo "$0: cannot run 'id -u'" 1>&2; return 1; }
|
||||
|
||||
# Make sure it gives valid output.
|
||||
case $my_uid in
|
||||
0) ;;
|
||||
*[!0-9]*)
|
||||
echo "$0: invalid output (\`$my_uid') from \`id -u'" 1>&2
|
||||
echo "$0: invalid output ('$my_uid') from 'id -u'" 1>&2
|
||||
return 1 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
|
||||
@@ -26,9 +26,9 @@ mode3=2755
|
||||
|
||||
|
||||
echo test > a || framework_failure_
|
||||
echo "\`a' -> \`b'" > out_installed_first || framework_failure_
|
||||
echo "removed \`b'
|
||||
\`a' -> \`b'" > out_installed_second || framework_failure_
|
||||
echo "'a' -> 'b'" > out_installed_first || framework_failure_
|
||||
echo "removed 'b'
|
||||
'a' -> 'b'" > out_installed_second || framework_failure_
|
||||
: > out_empty || framework_failure_
|
||||
|
||||
# destination file does not exist
|
||||
@@ -57,8 +57,8 @@ compare out out_installed_second || fail=1
|
||||
ln -s a c || framework_failure_
|
||||
ln -s b d || framework_failure_
|
||||
ginstall -Cv -m$mode1 c d > out || fail=1
|
||||
echo "removed \`d'
|
||||
\`c' -> \`d'" > out_installed_second_cd
|
||||
echo "removed 'd'
|
||||
'c' -> 'd'" > out_installed_second_cd
|
||||
compare out out_installed_second_cd || fail=1
|
||||
|
||||
# destination file exists but content differs
|
||||
|
||||
@@ -28,9 +28,9 @@ g2=2
|
||||
|
||||
|
||||
echo test > a || framework_failure_
|
||||
echo "\`a' -> \`b'" > out_installed_first
|
||||
echo "removed \`b'
|
||||
\`a' -> \`b'" > out_installed_second
|
||||
echo "'a' -> 'b'" > out_installed_first
|
||||
echo "removed 'b'
|
||||
'a' -> 'b'" > out_installed_second
|
||||
> out_empty
|
||||
|
||||
# destination file does not exist
|
||||
|
||||
@@ -24,9 +24,9 @@ require_selinux_
|
||||
echo test > a || framework_failure_
|
||||
chcon -u system_u a || skip_ "chcon doesn't work"
|
||||
|
||||
echo "\`a' -> \`b'" > out_installed_first
|
||||
echo "removed \`b'
|
||||
\`a' -> \`b'" > out_installed_second
|
||||
echo "'a' -> 'b'" > out_installed_first
|
||||
echo "removed 'b'
|
||||
'a' -> 'b'" > out_installed_second
|
||||
> out_empty
|
||||
|
||||
# destination file does not exist
|
||||
|
||||
@@ -107,7 +107,7 @@ for lang in C fr da; do
|
||||
: # ok
|
||||
else
|
||||
fail=1
|
||||
echo "*** $i: bad exit status \`$status' (expected $expected)," 1>&2
|
||||
echo "*** $i: bad exit status '$status' (expected $expected)," 1>&2
|
||||
echo " with --help or --version output redirected to /dev/full" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -64,7 +64,7 @@ case "$*" in
|
||||
A basic test of touch -m has just failed, so the subsequent
|
||||
tests in this file will not be run.
|
||||
|
||||
In the output below, the date of last modification for \`a' should
|
||||
In the output below, the date of last modification for 'a' should
|
||||
have been $t3.
|
||||
EOF
|
||||
#`
|
||||
@@ -83,7 +83,7 @@ case "$*" in
|
||||
A fundamental touch -a test has just failed, so the subsequent
|
||||
tests in this file will not be run.
|
||||
|
||||
In the output below, the date of last access for \`a' should
|
||||
In the output below, the date of last access for 'a' should
|
||||
have been $u1.
|
||||
EOF
|
||||
ls --full -lu a
|
||||
|
||||
@@ -30,14 +30,14 @@ d1=no
|
||||
dir=$d1/such-dir
|
||||
truncate -s0 $dir > out 2>&1 && fail=1
|
||||
cat <<EOF > exp
|
||||
truncate: cannot open \`$dir' for writing: No such file or directory
|
||||
truncate: cannot open '$dir' for writing: No such file or directory
|
||||
EOF
|
||||
compare exp out || fail=1
|
||||
|
||||
dir=$d1/
|
||||
truncate -s0 $dir > out 2>&1 && fail=1
|
||||
#The following can be returned at least
|
||||
#truncate: cannot open \`$dir' for writing: Not a directory
|
||||
#truncate: cannot open \`$dir' for writing: Is a directory
|
||||
#truncate: cannot open '$dir' for writing: Not a directory
|
||||
#truncate: cannot open '$dir' for writing: Is a directory
|
||||
|
||||
Exit $fail
|
||||
|
||||
@@ -186,11 +186,11 @@ my @Tests =
|
||||
{IN=>"a\na\nb\nc\nc\n"}, {OUT=>"\na\na\n\nc\nc\n"}],
|
||||
['118', '--all-repeated=prepend', {IN=>"a\nb\n"}, {OUT=>""}],
|
||||
['119', '--all-repeated=badoption', {IN=>"a\n"}, {OUT=>""}, {EXIT=>1},
|
||||
{ERR=>"$prog: invalid argument \`badoption' for \`--all-repeated'\n"
|
||||
{ERR=>"$prog: invalid argument 'badoption' for '--all-repeated'\n"
|
||||
. "Valid arguments are:\n"
|
||||
. " - \`none'\n"
|
||||
. " - \`prepend'\n"
|
||||
. " - \`separate'\n"
|
||||
. " - 'none'\n"
|
||||
. " - 'prepend'\n"
|
||||
. " - 'separate'\n"
|
||||
. $try}],
|
||||
# Check that -d and -u suppress all output, as POSIX requires.
|
||||
['120', qw(-d -u), {IN=>"a\na\n\b"}, {OUT=>""}],
|
||||
|
||||
@@ -25,7 +25,7 @@ print_ver_ mkdir mkfifo mknod
|
||||
require_selinux_enforcing_
|
||||
|
||||
c=invalid-selinux-context
|
||||
msg="failed to set default file creation context to \`$c':"
|
||||
msg="failed to set default file creation context to '$c':"
|
||||
|
||||
# Test each of mkdir, mknod, mkfifo with "-Z invalid-context".
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ for i in cp; do
|
||||
rm -fr a d; touch a; mkdir d
|
||||
$i --backup a a d/ 2>> out && fail=1
|
||||
cat <<EOF > exp
|
||||
$i: warning: source file \`a' specified more than once
|
||||
$i: warning: source file \`a' specified more than once
|
||||
$i: will not overwrite just-created \`d/a' with \`a'
|
||||
$i: warning: source file 'a' specified more than once
|
||||
$i: warning: source file 'a' specified more than once
|
||||
$i: will not overwrite just-created 'd/a' with 'a'
|
||||
EOF
|
||||
compare exp out || fail=1
|
||||
done
|
||||
@@ -56,8 +56,8 @@ for i in mv; do
|
||||
rm -fr a d; touch a; mkdir d
|
||||
$i ./a a d/ 2>> out && fail=1
|
||||
cat <<EOF > exp
|
||||
$i: cannot stat \`a': No such file or directory
|
||||
$i: cannot stat \`a': No such file or directory
|
||||
$i: cannot stat 'a': No such file or directory
|
||||
$i: cannot stat 'a': No such file or directory
|
||||
EOF
|
||||
compare exp out || fail=1
|
||||
done
|
||||
|
||||
@@ -29,7 +29,7 @@ ln $ff $ff2 || framework_failure_
|
||||
mv $ff $ff > out 2>&1 && fail=1
|
||||
|
||||
cat > exp <<EOF
|
||||
mv: \`$ff' and \`$ff' are the same file
|
||||
mv: '$ff' and '$ff' are the same file
|
||||
EOF
|
||||
|
||||
compare exp out || fail=1
|
||||
|
||||
@@ -36,7 +36,7 @@ cp -if e f < y > out 2>&1 || fail=1
|
||||
|
||||
# Make sure out contains the prompt.
|
||||
case "`cat out`" in
|
||||
"cp: try to overwrite \`f', overriding mode 0000 (---------)?"*) ;;
|
||||
"cp: try to overwrite 'f', overriding mode 0000 (---------)?"*) ;;
|
||||
*) fail=1 ;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ check_overwrite_prompt()
|
||||
{
|
||||
local delay="$1"
|
||||
case "`cat out`" in
|
||||
"mv: try to overwrite \`g', overriding mode 0000"*) ;;
|
||||
"mv: try to overwrite 'g', overriding mode 0000"*) ;;
|
||||
*) sleep $delay; return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ print_ver_ mv
|
||||
|
||||
# test miscellaneous combinations of -f -i -n parameters
|
||||
touch a b || framework_failure_
|
||||
echo "\`a' -> \`b'" > out_move
|
||||
echo "'a' -> 'b'" > out_move
|
||||
> out_empty
|
||||
|
||||
# ask for overwrite, answer no
|
||||
|
||||
@@ -52,16 +52,16 @@ sed "
|
||||
" out | sort > out2
|
||||
|
||||
cat <<EOF | sort > exp
|
||||
\`$null' -> \`XXX/$null'
|
||||
\`$dir' -> \`XXX/$dir'
|
||||
\`$dir/a' -> \`XXX/$dir/a'
|
||||
\`$dir/a/b' -> \`XXX/$dir/a/b'
|
||||
\`$dir/a/b/c' -> \`XXX/$dir/a/b/c'
|
||||
\`$dir/a/b/c/file1' -> \`XXX/$dir/a/b/c/file1'
|
||||
\`$dir/d' -> \`XXX/$dir/d'
|
||||
\`$dir/d/e' -> \`XXX/$dir/d/e'
|
||||
\`$dir/d/e/f' -> \`XXX/$dir/d/e/f'
|
||||
\`$dir/d/e/f/file2' -> \`XXX/$dir/d/e/f/file2'
|
||||
'$null' -> 'XXX/$null'
|
||||
'$dir' -> 'XXX/$dir'
|
||||
'$dir/a' -> 'XXX/$dir/a'
|
||||
'$dir/a/b' -> 'XXX/$dir/a/b'
|
||||
'$dir/a/b/c' -> 'XXX/$dir/a/b/c'
|
||||
'$dir/a/b/c/file1' -> 'XXX/$dir/a/b/c/file1'
|
||||
'$dir/d' -> 'XXX/$dir/d'
|
||||
'$dir/d/e' -> 'XXX/$dir/d/e'
|
||||
'$dir/d/e/f' -> 'XXX/$dir/d/e/f'
|
||||
'$dir/d/e/f/file2' -> 'XXX/$dir/d/e/f/file2'
|
||||
EOF
|
||||
|
||||
compare exp out2 || fail=1
|
||||
|
||||
@@ -38,7 +38,7 @@ printf \
|
||||
# On some (less-compliant) systems, we get EPERM in this case.
|
||||
# Accept either diagnostic.
|
||||
cat <<EOF > exp2
|
||||
mv: cannot move \`k' to \`$other_partition_tmpdir/k': Permission denied
|
||||
mv: cannot move 'k' to '$other_partition_tmpdir/k': Permission denied
|
||||
EOF
|
||||
|
||||
if cmp out exp >/dev/null 2>&1; then
|
||||
|
||||
@@ -52,7 +52,7 @@ done
|
||||
|
||||
# Test for a cp-specific diagnostic introduced after coreutils-8.7:
|
||||
printf '%s\n' \
|
||||
"cp: cannot create regular file \`no-such/': Not a directory" \
|
||||
"cp: cannot create regular file 'no-such/': Not a directory" \
|
||||
> expected-err
|
||||
touch b
|
||||
cp b no-such/ 2> err && fail=1
|
||||
|
||||
18
tests/rm/rm3
18
tests/rm/rm3
@@ -55,15 +55,15 @@ tr '?' '\n' < out | head --bytes=-1 | sed 's/^ //' |sort > o2
|
||||
mv o2 out
|
||||
|
||||
sort <<EOF > exp || fail=1
|
||||
rm: descend into directory \`z'
|
||||
rm: remove regular empty file \`z/empty'
|
||||
rm: remove write-protected regular file \`z/fu'
|
||||
rm: remove write-protected regular empty file \`z/empty-u'
|
||||
rm: remove symbolic link \`z/slink'
|
||||
rm: remove symbolic link \`z/slinkdot'
|
||||
rm: remove directory \`z/d'
|
||||
rm: remove write-protected directory \`z/du'
|
||||
rm: remove directory \`z'
|
||||
rm: descend into directory 'z'
|
||||
rm: remove regular empty file 'z/empty'
|
||||
rm: remove write-protected regular file 'z/fu'
|
||||
rm: remove write-protected regular empty file 'z/empty-u'
|
||||
rm: remove symbolic link 'z/slink'
|
||||
rm: remove symbolic link 'z/slinkdot'
|
||||
rm: remove directory 'z/d'
|
||||
rm: remove write-protected directory 'z/du'
|
||||
rm: remove directory 'z'
|
||||
EOF
|
||||
|
||||
compare exp out || fail=1
|
||||
|
||||
@@ -38,7 +38,7 @@ my @Tests =
|
||||
['unreadable-2', '-rf', $d,
|
||||
{EXIT => $uid == 0 ? 0 : 1},
|
||||
{ERR => $uid == 0 ? ''
|
||||
: "$prog: cannot remove \`$d': Permission denied\n"},
|
||||
: "$prog: cannot remove '$d': Permission denied\n"},
|
||||
{PRE => sub { (mkdir $d,0700 and mkdir "$d/x",0700 and chmod 0100,$d)
|
||||
or die "$d: $!\n"}} ],
|
||||
);
|
||||
|
||||
@@ -24,7 +24,7 @@ echo 'split: 1o: invalid number of chunks' > exp
|
||||
split -n l/1o 2>err && fail=1
|
||||
compare exp err || fail=1
|
||||
|
||||
echo "split: \`-': cannot determine file size" > exp
|
||||
echo "split: '-': cannot determine file size" > exp
|
||||
echo | split -n l/1 2>err && fail=1
|
||||
compare exp err || fail=1
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ file=/no-such-dir/file
|
||||
|
||||
touch $file > out 2>&1 && fail=1
|
||||
cat <<EOF > exp
|
||||
touch: cannot touch \`$file': No such file or directory
|
||||
touch: cannot touch '$file': No such file or directory
|
||||
EOF
|
||||
|
||||
compare exp out || fail=1
|
||||
|
||||
@@ -43,7 +43,7 @@ touch / > out 2>&1 && fail=1
|
||||
for msg in 'Not owner' 'Operation not permitted' 'Permission denied' \
|
||||
'Read-only file system'; do
|
||||
cat > exp <<EOF
|
||||
touch: setting times of \`/': $msg
|
||||
touch: setting times of '/': $msg
|
||||
EOF
|
||||
|
||||
cmp out exp > /dev/null 2>&1 && { match=1; break; }
|
||||
|
||||
Reference in New Issue
Block a user