From ae2b0d2ddca458eb282bb0458987e75e1875a659 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 7 Jan 2012 20:55:10 +0100 Subject: tests: more automated quote adjustment Relax initial regexp to match more instances, but add a filter to avoid some invalid conversions. Run this: git grep -l "\`[^']*'" tests | xargs perl -pi -e '$q=q"'\''";' \ -e '$q="$q\\$q$q"; /(= ?\`|\`expr|\`echo|\Q$q\E)/ and next;' \ -e ' s/\`([^'\''"]*?'\'')/'\''$1/g' The last disjunct in the above (...) filter is to exempt any line that contains this string: '\'' With quoting like that, converting a ` to ' is likely to cause trouble, so we'll handle those manually. Here are three examples where the exemption is required: *': `link-to-dir/'\'': hard link not allowed for directory'*) ;; printf 'creating file `%s'\''\n' $f 'mv: inter-device move failed: `%s'\'' to `%s'\'';'\ --- tests/Coreutils.pm | 16 ++++++++-------- tests/CuTmpdir.pm | 2 +- tests/check.mk | 4 ++-- tests/chgrp/basic | 2 +- tests/chgrp/deref | 2 +- tests/chmod/no-x | 2 +- tests/cp/fiemap-empty | 2 +- tests/cp/fiemap-perf | 2 +- tests/du/files0-from | 4 ++-- tests/du/two-args | 2 +- tests/install/create-leading | 2 +- tests/misc/basename | 2 +- tests/misc/cat-proc | 2 +- tests/misc/comm | 6 +++--- tests/misc/date-sec | 2 +- tests/misc/dirname | 2 +- tests/misc/factor | 2 +- tests/misc/fmt | 8 ++++---- tests/misc/join | 2 +- tests/misc/mktemp | 18 +++++++++--------- tests/misc/nohup | 4 ++-- tests/misc/od | 2 +- tests/misc/printf-cov | 2 +- tests/misc/seq | 10 +++++----- tests/misc/sha1sum-vec | 4 ++-- tests/misc/sort | 26 +++++++++++++------------- tests/misc/sort-compress | 2 +- tests/misc/sort-files0-from | 6 +++--- tests/misc/sort-merge | 12 ++++++------ tests/misc/stdbuf | 2 +- tests/misc/tac | 2 +- tests/misc/tail | 4 ++-- tests/misc/test | 2 +- tests/misc/test-diag | 2 +- tests/misc/timeout | 2 +- tests/misc/tr | 6 +++--- tests/misc/tsort | 2 +- tests/misc/tty-eof | 2 +- tests/misc/wc-files0-from | 4 ++-- tests/misc/xstrtol | 2 +- tests/mv/hard-3 | 2 +- tests/mv/i-1 | 2 +- tests/pr/pr-tests | 4 ++-- tests/rm/deep-1 | 2 +- tests/rm/empty-name | 4 ++-- tests/rm/fail-eperm | 16 ++++++++-------- tests/rm/no-give-up | 2 +- tests/split/lines | 2 +- 48 files changed, 108 insertions(+), 108 deletions(-) (limited to 'tests') diff --git a/tests/Coreutils.pm b/tests/Coreutils.pm index 7f4a0372c..4d2d796d8 100644 --- a/tests/Coreutils.pm +++ b/tests/Coreutils.pm @@ -61,7 +61,7 @@ defined $ENV{DJDIR} # stdout from cmd # {OUT => {'filename'=>[$CTOR, $DTOR]}} $CTOR and $DTOR are references to # functions, each which is passed the single argument 'filename'. -# $CTOR must create `filename'. +# $CTOR must create 'filename'. # DTOR may be omitted in which case 'sub{unlink @_[0]}' is used. # FIXME: implement this # {ERR => ...} @@ -78,7 +78,7 @@ defined $ENV{DJDIR} # diagnostics: Operation not permitted, Not owner, and Permission denied. # {EXIT => N} expect exit status of cmd to be N # {ENV => 'VAR=val ...'} -# Prepend 'VAR=val ...' to the command that we execute via `system'. +# Prepend 'VAR=val ...' to the command that we execute via 'system'. # {ENV_DEL => 'VAR'} # Remove VAR from the environment just before running the corresponding # command, and restore any value just afterwards. @@ -114,7 +114,7 @@ sub _create_file ($$$$) ++$Global_count; } - warn "creating file `$file' with contents `$data'\n" if $debug; + warn "creating file '$file' with contents '$data'\n" if $debug; # The test spec gave a string. # Write it to a temp file and return tempfile name. @@ -183,7 +183,7 @@ sub _process_file_spec ($$$$$) else { # FIXME: put $srcdir in here somewhere - warn "$program_name: $test_name: specified file `$file' does" + warn "$program_name: $test_name: specified file '$file' does" . " not exist\n" if ! -f "$srcdir/$file"; } @@ -314,7 +314,7 @@ sub run_tests ($$$$$) . " expected 1\n" if $n != 1; my ($type, $val) = each %$io_spec; - die "$program_name: $test_name: invalid key `$type' in test spec\n" + die "$program_name: $test_name: invalid key '$type' in test spec\n" if ! $Types{$type}; # Make sure there's no more than one of OUT, ERR, EXIT, etc. @@ -350,7 +350,7 @@ sub run_tests ($$$$$) or die "$program_name: $test_name: CMP spec has $n " . "elements -- expected 1\n"; - # Replace any `@AUX@' in the key of %$e. + # Replace any '@AUX@' in the key of %$e. my ($ff, $val) = each %$e; my $new_ff = _at_replace $expect, $ff; if ($new_ff ne $ff) @@ -474,7 +474,7 @@ sub run_tests ($$$$$) and $pushed_env{$env_sym} = $val; } - warn "Running command: `$cmd_str'\n" if $debug; + warn "Running command: '$cmd_str'\n" if $debug; my $rc = 0xffff & system $cmd_str; # Restore any environment setting we changed via a deletion. @@ -486,7 +486,7 @@ sub run_tests ($$$$$) if ($rc == 0xff00) { warn "$program_name: test $test_name failed: command failed:\n" - . " `$cmd_str': $!\n"; + . " '$cmd_str': $!\n"; $fail = 1; goto cleanup; } diff --git a/tests/CuTmpdir.pm b/tests/CuTmpdir.pm index 05c302995..efa646213 100644 --- a/tests/CuTmpdir.pm +++ b/tests/CuTmpdir.pm @@ -28,7 +28,7 @@ my $dir; sub skip_test($) { - warn "$ME: skipping test: unsafe working directory name: `$_[0]'\n"; + warn "$ME: skipping test: unsafe working directory name: '$_[0]'\n"; exit 77; } diff --git a/tests/check.mk b/tests/check.mk index b66e6a3ed..cb67b9dde 100644 --- a/tests/check.mk +++ b/tests/check.mk @@ -44,11 +44,11 @@ check-am: .built-programs && MAKEFLAGS= $(MAKE) -s built_programs.list) \ > $@-t && mv $@-t $@ -## `$f' is set by the Automake-generated test harness to the path of the +## '$f' is set by the Automake-generated test harness to the path of the ## current test script stripped of VPATH components, and is used by the ## shell-or-perl script to determine the name of the temporary files to be ## used. Note that $f is a shell variable, not a make macro, so the use of -## `$$f' below is correct, and not a typo. +## '$$f' below is correct, and not a typo. LOG_COMPILER = \ $(SHELL) $(srcdir)/shell-or-perl \ --test-name "$$f" --srcdir '$(srcdir)' \ diff --git a/tests/chgrp/basic b/tests/chgrp/basic index 0cf0bca84..9c384ba38 100755 --- a/tests/chgrp/basic +++ b/tests/chgrp/basic @@ -66,7 +66,7 @@ chown --from=:$g1 :$g2 f; test `stat --printf=%g f` = $g2 || fail=1 # This *should* change the group of f. # Though note that the diagnostic is misleading in that -# it says the 'group of `symlink'' has been changed. +# it says the 'group of 'symlink'' has been changed. chgrp $g1 symlink; test `stat --printf=%g f` = $g1 || fail=1 chown --from=:$g1 :$g2 f; test `stat --printf=%g f` = $g2 || fail=1 diff --git a/tests/chgrp/deref b/tests/chgrp/deref index cf1ddd869..dcdc4367a 100755 --- a/tests/chgrp/deref +++ b/tests/chgrp/deref @@ -52,7 +52,7 @@ set _ `ls -ln f`; g=$5; test "$g" = $g2 || fail=1 # This *should* change the group of f. # Though note that the diagnostic you'd get with -c is misleading in that -# it says the 'group of `symlink'' has been changed. +# it says the 'group of 'symlink'' has been changed. chgrp --dereference $g1 symlink set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1 set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1 diff --git a/tests/chmod/no-x b/tests/chmod/no-x index cc0d14268..19f439832 100755 --- a/tests/chmod/no-x +++ b/tests/chmod/no-x @@ -47,7 +47,7 @@ EOF compare exp out || fail=1 cd a -# This will fail with '`chmod: fts_read failed: Permission denied'' +# This will fail with ''chmod: fts_read failed: Permission denied'' chmod a-x . b 2> /dev/null && fail=1 # chmod must exit with status 1. # Due to a bug in coreutils-5.93's fts.c, chmod would provoke diff --git a/tests/cp/fiemap-empty b/tests/cp/fiemap-empty index 951d8e062..efa4b660d 100755 --- a/tests/cp/fiemap-empty +++ b/tests/cp/fiemap-empty @@ -48,7 +48,7 @@ fallocate -l 600MiB space.test || # Disable this test on old BTRFS (e.g. Fedora 14) # which reports ordinary extents for unwritten ones. -filefrag space.test || skip_ 'the 'filefrag` utility is missing' +filefrag space.test || skip_ 'the 'filefrag' utility is missing' filefrag -v space.test | grep -F 'unwritten' > /dev/null || skip_ 'this file system does not report empty extents as "unwritten"' diff --git a/tests/cp/fiemap-perf b/tests/cp/fiemap-perf index 3addfe1b2..e418728ee 100755 --- a/tests/cp/fiemap-perf +++ b/tests/cp/fiemap-perf @@ -34,7 +34,7 @@ timeout 10 truncate -s1T f || framework_failure_ # Disable this test on old BTRFS (e.g. Fedora 14) # which reports (unwritten) extents for holes. -filefrag f || skip_ 'the 'filefrag` utility is missing' +filefrag f || skip_ 'the 'filefrag' utility is missing' filefrag f | grep -F ': 0 extents found' > /dev/null || skip_ 'this file system reports extents for holes' diff --git a/tests/du/files0-from b/tests/du/files0-from index c62c2a805..67e1e2e76 100755 --- a/tests/du/files0-from +++ b/tests/du/files0-from @@ -30,14 +30,14 @@ my @Tests = ( # invalid extra command line argument ['f-extra-arg', '--files0-from=- no-such', {IN=>"a"}, {EXIT=>1}, - {ERR => "$prog: extra operand `no-such'\n" + {ERR => "$prog: extra operand 'no-such'\n" . "file operands cannot be combined with --files0-from\n" . "Try '$prog --help' for more information.\n"} ], # missing input file ['missing', '--files0-from=missing', {EXIT=>1}, - {ERR => "$prog: cannot open `missing' for reading: " + {ERR => "$prog: cannot open 'missing' for reading: " . "No such file or directory\n"}], # input file name of '-' diff --git a/tests/du/two-args b/tests/du/two-args index 0d88c98ed..7b4359dc9 100755 --- a/tests/du/two-args +++ b/tests/du/two-args @@ -32,7 +32,7 @@ mkdir -p $t/1 $t/2 || framework_failure_ test -d $t || fail=1 du $t/1 $t/2 > /dev/null || fail=1 -# Make sure `du . $t' and `du .. $t' work. +# Make sure 'du . $t' and 'du .. $t' work. # These would fail prior to fileutils-4.0y. du . $t > /dev/null || fail=1 du .. $t > /dev/null || fail=1 diff --git a/tests/install/create-leading b/tests/install/create-leading index d349f601c..d1fea0682 100755 --- a/tests/install/create-leading +++ b/tests/install/create-leading @@ -26,7 +26,7 @@ print_ver_ ginstall file=file echo foo > $file -# Before 4.0q, this would mistakenly create $file, not `dest' +# Before 4.0q, this would mistakenly create $file, not 'dest' # in no-dir1/no-dir2/. ginstall -D $file no-dir1/no-dir2/dest || fail=1 test -d no-dir1/no-dir2 || fail=1 diff --git a/tests/misc/basename b/tests/misc/basename index 349aac8f5..fefe58c79 100755 --- a/tests/misc/basename +++ b/tests/misc/basename @@ -34,7 +34,7 @@ my @Tests = ( ['fail-1', {ERR => "$prog: missing operand\n" . "Try '$prog --help' for more information.\n"}, {EXIT => '1'}], - ['fail-2', qw(a b c), {ERR => "$prog: extra operand `c'\n" + ['fail-2', qw(a b c), {ERR => "$prog: extra operand 'c'\n" . "Try '$prog --help' for more information.\n"}, {EXIT => '1'}], ['a', qw(d/f), {OUT => 'f'}], diff --git a/tests/misc/cat-proc b/tests/misc/cat-proc index 99e064bf9..082c727e0 100755 --- a/tests/misc/cat-proc +++ b/tests/misc/cat-proc @@ -1,5 +1,5 @@ #!/bin/sh -# Ensure that cat -E produces same output as cat, module `$'s, +# Ensure that cat -E produces same output as cat, module '$'s, # even when applied to a file in /proc. # Copyright (C) 2006-2012 Free Software Foundation, Inc. diff --git a/tests/misc/comm b/tests/misc/comm index c727f80fc..905b5f862 100755 --- a/tests/misc/comm +++ b/tests/misc/comm @@ -57,7 +57,7 @@ my @Tests = # invalid missing command line argument (1) ['missing-arg1', $inputs[0], {EXIT=>1}, - {ERR => "$prog: missing operand after `a'\n" + {ERR => "$prog: missing operand after 'a'\n" . "Try '$prog --help' for more information.\n"}], # invalid missing command line argument (both) @@ -67,7 +67,7 @@ my @Tests = # invalid extra command line argument ['extra-arg', @inputs, 'no-such', {EXIT=>1}, - {ERR => "$prog: extra operand `no-such'\n" + {ERR => "$prog: extra operand 'no-such'\n" . "Try '$prog --help' for more information.\n"}], # out-of-order input @@ -133,7 +133,7 @@ my @Tests = # invalid empty delimiter ['delim-empty', '--output-delimiter=', @inputs, {EXIT=>1}, - {ERR => "$prog: empty `--output-delimiter' not allowed\n"}], + {ERR => "$prog: empty '--output-delimiter' not allowed\n"}], # invalid dual delimiter ['delim-dual', '--output-delimiter=,', '--output-delimiter=+', diff --git a/tests/misc/date-sec b/tests/misc/date-sec index b36b6759f..32463cf39 100755 --- a/tests/misc/date-sec +++ b/tests/misc/date-sec @@ -1,6 +1,6 @@ #!/bin/sh # Ensure that a command like -# `date --date="21:04 +0100" +%S' always prints `00'. +# `date --date="21:04 +0100" +%S' always prints '00'. # Before coreutils-5.2.1, it would print the seconds from the current time. # Copyright (C) 2004, 2006, 2008-2012 Free Software Foundation, Inc. diff --git a/tests/misc/dirname b/tests/misc/dirname index 67a374ede..37cf7cf18 100755 --- a/tests/misc/dirname +++ b/tests/misc/dirname @@ -35,7 +35,7 @@ my @Tests = ( ['fail-1', {ERR => "$prog: missing operand\n" . "Try '$prog --help' for more information.\n"}, {EXIT => '1'}], - ['fail-2', qw(a b), {ERR => "$prog: extra operand `b'\n" + ['fail-2', qw(a b), {ERR => "$prog: extra operand 'b'\n" . "Try '$prog --help' for more information.\n"}, {EXIT => '1'}], ['a', qw(d/f), {OUT => 'd'}], diff --git a/tests/misc/factor b/tests/misc/factor index d5565d66c..97da9c474 100755 --- a/tests/misc/factor +++ b/tests/misc/factor @@ -63,7 +63,7 @@ my @Tests = {EXIT => 1}], ['cont', 'a 4', {OUT => "4: 2 2\n"}, - {ERR => "$prog: `a' is not a valid positive integer\n"}, + {ERR => "$prog: 'a' is not a valid positive integer\n"}, {EXIT => 1}], ); diff --git a/tests/misc/fmt b/tests/misc/fmt index ef10e8274..e94d6134e 100755 --- a/tests/misc/fmt +++ b/tests/misc/fmt @@ -26,13 +26,13 @@ my @Tests = {IN=> "ça\nçb\n"}, {OUT=>"ça b\n"}], ['wide-1', '-w 32768', - {ERR => "fmt: invalid width: `32768'\n"}, {EXIT => 1}], + {ERR => "fmt: invalid width: '32768'\n"}, {EXIT => 1}], ['wide-2', '-w 2147483647', - {ERR => "fmt: invalid width: `2147483647'\n"}, {EXIT => 1}], + {ERR => "fmt: invalid width: '2147483647'\n"}, {EXIT => 1}], ['bad-suffix', '-72x', {IN=> ''}, - {ERR => "fmt: invalid width: `72x'\n"}, {EXIT => 1}], + {ERR => "fmt: invalid width: '72x'\n"}, {EXIT => 1}], ['no-file', 'no-such-file', - {ERR => "fmt: cannot open `no-such-file' for reading:" + {ERR => "fmt: cannot open 'no-such-file' for reading:" . " No such file or directory\n"}, {EXIT => 1}], ['obs-1', '-c -72', {ERR => "fmt: invalid option -- 7; -WIDTH is recognized only when it" diff --git a/tests/misc/join b/tests/misc/join index 8fa099464..a3fd1a8fa 100755 --- a/tests/misc/join +++ b/tests/misc/join @@ -173,7 +173,7 @@ my @tv = ( # FIXME: change this to ensure the diagnostic makes sense ['invalid-j', '-j x', {}, "", 1, - "$prog: invalid field number: `x'\n"], + "$prog: invalid field number: 'x'\n"], # With ordering check, inputs in order ['chkodr-1', '--check-order', diff --git a/tests/misc/mktemp b/tests/misc/mktemp index 40bbe5100..c6291fbb6 100755 --- a/tests/misc/mktemp +++ b/tests/misc/mktemp @@ -61,7 +61,7 @@ my @Tests = ['too-many-q', '-q a b', {EXIT => 1} ], ['too-few-x', 'foo.XX', {EXIT => 1}, - {ERR=>"$prog: too few X's in template `foo.XX'\n"}], + {ERR=>"$prog: too few X's in template 'foo.XX'\n"}], ['too-few-xq', '-q foo.XX', {EXIT => 1} ], ['1f', 'bar.XXXX', {OUT => "bar.ZZZZ\n"}, @@ -103,11 +103,11 @@ my @Tests = # Test bad templates ['invalid-tl', '-t a/bXXXX', - {ERR=>"$prog: invalid template, `a/bXXXX', " + {ERR=>"$prog: invalid template, 'a/bXXXX', " . "contains directory separator\n"}, {EXIT => 1} ], ['invalid-t2', '--tmpdir=a /bXXXX', - {ERR=>"$prog: invalid template, `/bXXXX'; " + {ERR=>"$prog: invalid template, '/bXXXX'; " . "with --tmpdir, it may not be absolute\n"}, {EXIT => 1} ], # Suffix after X. @@ -144,17 +144,17 @@ my @Tests = check_tmp $f, 'F'; }}], ['suffix5f', '--suffix /b aXXXX', {EXIT=>1}, - {ERR=>"$prog: invalid suffix `/b', contains directory separator\n"}], + {ERR=>"$prog: invalid suffix '/b', contains directory separator\n"}], ['suffix6f', 'aXXXX/b', {EXIT=>1}, - {ERR=>"$prog: invalid suffix `/b', contains directory separator\n"}], + {ERR=>"$prog: invalid suffix '/b', contains directory separator\n"}], ['suffix6f-q', '-q aXXXX/b', {EXIT=>1}], ['suffix7f', '--suffix= aXXXXb', {EXIT=>1}, - {ERR=>"$prog: with --suffix, template `aXXXXb' must end in X\n"}], + {ERR=>"$prog: with --suffix, template 'aXXXXb' must end in X\n"}], ['suffix7f-q', '-q --suffix= aXXXXb', {EXIT=>1}], ['suffix7d', '-d --suffix=aXXXXb ""', {EXIT=>1}, - {ERR=>"$prog: with --suffix, template `' must end in X\n"}], + {ERR=>"$prog: with --suffix, template '' must end in X\n"}], ['suffix8f', 'aXXXX --suffix=b', {OUT=>"aZZZZb\n"}, {OUT_SUBST=>'s,^a....,aZZZZ,'}, @@ -167,9 +167,9 @@ my @Tests = . "Try '$prog --help' for more information.\n"}], ['suffix10f', 'aXXb', {EXIT => 1}, - {ERR=>"$prog: too few X's in template `aXXb'\n"}], + {ERR=>"$prog: too few X's in template 'aXXb'\n"}], ['suffix10d', '-d --suffix=X aXX', {EXIT => 1}, - {ERR=>"$prog: too few X's in template `aXXX'\n"}], + {ERR=>"$prog: too few X's in template 'aXXX'\n"}], ['suffix11f', '--suffix=.txt', {OUT=>"./tmp.ZZZZZZZZZZ.txt\n"}, {ENV=>"TMPDIR=."}, diff --git a/tests/misc/nohup b/tests/misc/nohup index e20a22c70..0fa1f3dc0 100755 --- a/tests/misc/nohup +++ b/tests/misc/nohup @@ -50,9 +50,9 @@ rm -f nohup.out err exp # change depending on whether stderr is redirected. nohup sh -c 'echo stdout; echo stderr 1>&2' >out || fail=1 if test -t 2; then - test "`cat out|tr '\n' -`" = stdout-stderr- || fail=1 + test "'cat out|tr '\n' -`" = stdout-stderr- || fail=1 else - test "`cat out|tr '\n' -`" = stdout- || fail=1 + test "'cat out|tr '\n' -`" = stdout- || fail=1 fi # It must *not* exist. test -f nohup.out && fail=1 diff --git a/tests/misc/od b/tests/misc/od index 75ff2f159..46d4601d6 100755 --- a/tests/misc/od +++ b/tests/misc/od @@ -32,7 +32,7 @@ my $proc_file = '/proc/version'; # Count the bytes in $proc_file, _by reading_. my $len = 0; open FH, '<', $proc_file - or die "$program_name: can't open `$proc_file' for reading: $!\n"; + or die "$program_name: can't open '$proc_file' for reading: $!\n"; while (defined (my $line = )) { $len += length $line; diff --git a/tests/misc/printf-cov b/tests/misc/printf-cov index c3a6861d6..64f2d95bb 100755 --- a/tests/misc/printf-cov +++ b/tests/misc/printf-cov @@ -83,7 +83,7 @@ my @Tests = {OUT=>"inaccurate"}, {OUT_SUBST => 's/\d+/inaccurate/'}, {ERR=>"$prog: 9...9\n"}, {ERR_SUBST => 's/9+.*/9...9/'}], ['excess', 'B 1', {OUT=>'B'}, - {ERR=>"$prog: warning: ignoring excess arguments, starting with `1'\n"}], + {ERR=>"$prog: warning: ignoring excess arguments, starting with '1'\n"}], ['percent', '%%', {OUT=>'%'}], ['d-sp', q('% d' 33), {OUT=>' 33'}], ['d-plus', q('%+d' 33), {OUT=>'+33'}], diff --git a/tests/misc/seq b/tests/misc/seq index 05770b0da..3ea869f62 100755 --- a/tests/misc/seq +++ b/tests/misc/seq @@ -82,20 +82,20 @@ my @Tests = # In coreutils-[6.0..6.9], this would mistakenly succeed and print "%Lg". ['fmt-c', qw(-f %%g 1), {EXIT => 1}, - {ERR => "seq: format `%%g' has no % directive\n"}], + {ERR => "seq: format '%%g' has no % directive\n"}], # In coreutils-6.9..6.10, this would fail with an erroneous diagnostic: # "seq: memory exhausted". In coreutils-6.0..6.8, it would mistakenly # succeed and print a blank line. ['fmt-eos1', qw(-f % 1), {EXIT => 1}, - {ERR => "seq: format `%' ends in %\n"}], + {ERR => "seq: format '%' ends in %\n"}], ['fmt-eos2', qw(-f %g% 1), {EXIT => 1}, - {ERR => "seq: format `%g%' has too many % directives\n"}], + {ERR => "seq: format '%g%' has too many % directives\n"}], ['fmt-d', qw(-f "" 1), {EXIT => 1}, - {ERR => "seq: format `' has no % directive\n"}], + {ERR => "seq: format '' has no % directive\n"}], ['fmt-e', qw(-f %g%g 1), {EXIT => 1}, - {ERR => "seq: format `%g%g' has too many % directives\n"}], + {ERR => "seq: format '%g%g' has too many % directives\n"}], # With coreutils-6.12 and earlier, with a UTF8 numeric locale that uses # something other than "." as the decimal point, this use of seq would diff --git a/tests/misc/sha1sum-vec b/tests/misc/sha1sum-vec index 4c7c06afd..d7b5e0d8e 100755 --- a/tests/misc/sha1sum-vec +++ b/tests/misc/sha1sum-vec @@ -495,8 +495,8 @@ sub binary_expand ($$) defined $n && defined $b or die "$test_name: too few args\n"; my @a = split ' ', $rest, $n + 1; my $caret = pop @a; - $caret eq '^' or die "test $test_name: @a missing `^'\n"; - $b eq '1' || $b eq '0' or die "test $test_name: bad `b'=$b\n"; + $caret eq '^' or die "test $test_name: @a missing '^'\n"; + $b eq '1' || $b eq '0' or die "test $test_name: bad 'b'=$b\n"; my $n_bad = @a; @a == $n or die "test $test_name: wrong number of args (expected $n, found $n_bad)\n"; diff --git a/tests/misc/sort b/tests/misc/sort index ea27faa25..5be00a017 100755 --- a/tests/misc/sort +++ b/tests/misc/sort @@ -71,7 +71,7 @@ my @Tests = ["h6", '-h', {IN=>"1GiB\n1030MiB\n"}, {OUT=>"1030MiB\n1GiB\n"}], # check option incompatibility ["h7", '-hn', {IN=>""}, {OUT=>""}, {EXIT=>2}, - {ERR=>"$prog: options `-hn' are incompatible\n"}], + {ERR=>"$prog: options '-hn' are incompatible\n"}], # check key processing ["h8", '-n -k2,2h', {IN=>"1 1E\n2 2M\n"}, {OUT=>"2 2M\n1 1E\n"}], # SI and IEC prefixes on separate keys allowed @@ -105,13 +105,13 @@ my @Tests = ["03c", '-k1 -k2', {IN=>"A b\nA a\n"}, {OUT=>"A a\nA b\n"}], # Fail with a diagnostic when -k specifies field == 0. ["03d", '-k0', {EXIT=>2}, - {ERR=>"$prog: -: invalid field specification `0'\n"}, + {ERR=>"$prog: -: invalid field specification '0'\n"}, $normalize_filename], # Fail with a diagnostic when -k specifies character == 0. ["03e", '-k1.0', {EXIT=>2}, - {ERR=>"$prog: character offset is zero: invalid field specification `1.0'\n"}], + {ERR=>"$prog: character offset is zero: invalid field specification '1.0'\n"}], ["03f", '-k1.1,-k0', {EXIT=>2}, - {ERR=>"$prog: invalid number after `,': invalid count at start of `-k0'\n"}], + {ERR=>"$prog: invalid number after ',': invalid count at start of '-k0'\n"}], # This is ok. ["03g", '-k1.1,1.0', {IN=>''}], # This is equivalent to 3f. @@ -158,10 +158,10 @@ my @Tests = # # report an error for '.' without following char spec ["08a", '-k 2.,3', {EXIT=>2}, - {ERR=>"$prog: invalid number after `.': invalid count at start of `,3'\n"}], + {ERR=>"$prog: invalid number after '.': invalid count at start of ',3'\n"}], # report an error for ',' without following POS2 ["08b", '-k 2,', {EXIT=>2}, - {ERR=>"$prog: invalid number after `,': invalid count at start of `'\n"}], + {ERR=>"$prog: invalid number after ',': invalid count at start of ''\n"}], # # Test new -g option. ["09a", '-g', {IN=>"1e2\n2e1\n"}, {OUT=>"2e1\n1e2\n"}], @@ -334,19 +334,19 @@ my @Tests = # Specifying incompatible options should evoke a failure. ["incompat1", '-in', {EXIT=>2}, - {ERR=>"$prog: options `-in' are incompatible\n"}], + {ERR=>"$prog: options '-in' are incompatible\n"}], ["incompat2", '-nR', {EXIT=>2}, - {ERR=>"$prog: options `-nR' are incompatible\n"}], + {ERR=>"$prog: options '-nR' are incompatible\n"}], ["incompat3", '-dfgiMnR', {EXIT=>2}, - {ERR=>"$prog: options `-dfgMnR' are incompatible\n"}], + {ERR=>"$prog: options '-dfgMnR' are incompatible\n"}], ["incompat4", qw(-c -o /dev/null), {EXIT=>2}, - {ERR=>"$prog: options `-co' are incompatible\n"}], + {ERR=>"$prog: options '-co' are incompatible\n"}], ["incompat5", qw(-C -o /dev/null), {EXIT=>2}, - {ERR=>"$prog: options `-Co' are incompatible\n"}], + {ERR=>"$prog: options '-Co' are incompatible\n"}], ["incompat6", '-cC', {EXIT=>2}, - {ERR=>"$prog: options `-cC' are incompatible\n"}], + {ERR=>"$prog: options '-cC' are incompatible\n"}], ["incompat7", qw(--sort=random -n), {EXIT=>2}, - {ERR=>"$prog: options `-nR' are incompatible\n"}], + {ERR=>"$prog: options '-nR' are incompatible\n"}], # -t '\0' is accepted, as of coreutils-5.0.91 ['nul-tab', "-k2,2 -t '\\0'", diff --git a/tests/misc/sort-compress b/tests/misc/sort-compress index 09d6720d8..9a4b9f622 100755 --- a/tests/misc/sort-compress +++ b/tests/misc/sort-compress @@ -35,7 +35,7 @@ EOF chmod +x gzip -# Ensure 'sort` is immune to parent's SIGCHLD handler +# Ensure 'sort' is immune to parent's SIGCHLD handler # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh. ( # ash doesn't support "trap '' CHLD"; it knows only signal numbers. diff --git a/tests/misc/sort-files0-from b/tests/misc/sort-files0-from index 1b362ac45..6aa10acc1 100755 --- a/tests/misc/sort-files0-from +++ b/tests/misc/sort-files0-from @@ -30,14 +30,14 @@ my @Tests = ( # invalid extra command line argument ['f-extra-arg', '--files0-from=- no-such', {IN=>"a"}, {EXIT=>2}, - {ERR => "$prog: extra operand `no-such'\n" + {ERR => "$prog: extra operand 'no-such'\n" . "file operands cannot be combined with --files0-from\n" . "Try '$prog --help' for more information.\n"} ], # missing input file ['missing', '--files0-from=missing', {EXIT=>2}, - {ERR => "$prog: cannot open `missing' for reading: " + {ERR => "$prog: cannot open 'missing' for reading: " . "No such file or directory\n"}], # input file name of '-' @@ -51,7 +51,7 @@ my @Tests = # empty input, from non-regular file ['empty-nonreg', '--files0-from=/dev/null', {EXIT=>2}, - {ERR => "$prog: no input from `/dev/null'\n"}], + {ERR => "$prog: no input from '/dev/null'\n"}], # one NUL ['nul-1', '--files0-from=-', '<', {IN=>"\0"}, {EXIT=>2}, diff --git a/tests/misc/sort-merge b/tests/misc/sort-merge index 3303d10af..8cdde1875 100755 --- a/tests/misc/sort-merge +++ b/tests/misc/sort-merge @@ -42,12 +42,12 @@ my @Tests = # check validation of --batch-size option ['nmerge-0', "-m --batch-size=0", @inputs, - {ERR=>"$prog: invalid --batch-size argument `0'\n". - "$prog: minimum --batch-size argument is `2'\n"}, {EXIT=>2}], + {ERR=>"$prog: invalid --batch-size argument '0'\n". + "$prog: minimum --batch-size argument is '2'\n"}, {EXIT=>2}], ['nmerge-1', "-m --batch-size=1", @inputs, - {ERR=>"$prog: invalid --batch-size argument `1'\n". - "$prog: minimum --batch-size argument is `2'\n"}, {EXIT=>2}], + {ERR=>"$prog: invalid --batch-size argument '1'\n". + "$prog: minimum --batch-size argument is '2'\n"}, {EXIT=>2}], ['nmerge-neg', "-m --batch-size=-1", @inputs, {ERR=>"$prog: invalid --batch-size argument '-1'\n"}, {EXIT=>2}], @@ -57,7 +57,7 @@ my @Tests = ['nmerge-big', "-m --batch-size=$bigint", @inputs, {ERR_SUBST=>'s/(current rlimit is) \d+/$1/'}, - {ERR=>"$prog: --batch-size argument `$bigint' too large\n". + {ERR=>"$prog: --batch-size argument '$bigint' too large\n". "$prog: maximum --batch-size argument with current rlimit is\n"}, {EXIT=>2}], @@ -68,7 +68,7 @@ my @Tests = # temp files are needed ['nmerge-no', "-m --batch-size=2 -T$badtmp", @inputs, {ERR_SUBST=>"s|': .*|':|"}, - {ERR=>"$prog: cannot create temporary file in `$badtmp':\n"}, + {ERR=>"$prog: cannot create temporary file in '$badtmp':\n"}, {EXIT=>2}], # This used to fail because setting batch-size without also setting diff --git a/tests/misc/stdbuf b/tests/misc/stdbuf index 99bb24300..bf4edc179 100755 --- a/tests/misc/stdbuf +++ b/tests/misc/stdbuf @@ -96,7 +96,7 @@ retry_delay_ stdbuf_unbuffer .1 6 || fail=1 # One could remove the need for dd (used to close the fifo to get uniq to quit # early), if head -n1 read stdin char by char. Note uniq | head -c2 doesn't # suffice due to the buffering implicit in the pipe. sed currently does read -# stdin char by char, so we can test with 'sed 1q`. However I'm wary about +# stdin char by char, so we can test with 'sed 1q'. However I'm wary about # adding this dependency on a program outside of coreutils. # printf '2\n' > exp # printf '1\n2\n' | (stdbuf -i0 sed 1q >/dev/null; cat) > out diff --git a/tests/misc/tac b/tests/misc/tac index 48c872f62..077cc0c9d 100755 --- a/tests/misc/tac +++ b/tests/misc/tac @@ -67,7 +67,7 @@ my @Tests = ['pipe-bad-tmpdir', {ENV => "TMPDIR=$bad_dir"}, {IN_PIPE => "a\n"}, - {ERR_SUBST => "s,`$bad_dir': .*,...,"}, + {ERR_SUBST => "s,'$bad_dir': .*,...,"}, {ERR => "$prog: failed to create temporary file in ...\n"}, {EXIT => 1}], diff --git a/tests/misc/tail b/tests/misc/tail index 910297664..41c2f9a99 100755 --- a/tests/misc/tail +++ b/tests/misc/tail @@ -56,13 +56,13 @@ my @tv = ( ['obs-b', '-b', "x\n" x (512 * 10 / 2 + 1), "x\n" x (512 * 10 / 2), 0], ['err-1', '+cl', '', '', 1, - "$prog: cannot open `+cl' for reading: No such file or directory\n"], + "$prog: cannot open '+cl' for reading: No such file or directory\n"], ['err-2', '-cl', '', '', 1, "$prog: l: invalid number of bytes\n"], ['err-3', '+2cz', '', '', 1, - "$prog: cannot open `+2cz' for reading: No such file or directory\n"], + "$prog: cannot open '+2cz' for reading: No such file or directory\n"], # This should get 'tail: invalid option -- 2' ['err-4', '-2cX', '', '', 1, diff --git a/tests/misc/test b/tests/misc/test index aad07d057..ac30c3790 100755 --- a/tests/misc/test +++ b/tests/misc/test @@ -175,7 +175,7 @@ my @Tests = ['lt-5', "$limits->{INTMAX_UFLOW} -lt $limits->{UINTMAX_OFLOW}"], ['inv-1', qw(0x0 -eq 00), {EXIT=>2}, - {ERR=>"$prog: invalid integer `0x0'\n"}], + {ERR=>"$prog: invalid integer '0x0'\n"}], ['t1', "-t"], ['t2', qw(-t 1), {EXIT=>1}], diff --git a/tests/misc/test-diag b/tests/misc/test-diag index c6e15cf47..9c0ce227f 100755 --- a/tests/misc/test-diag +++ b/tests/misc/test-diag @@ -27,7 +27,7 @@ my $prog = "$ENV{abs_top_builddir}/src/test"; my @Tests = ( # In coreutils-5.93, this diagnostic lacked the newline. - ['o', '-o arg', {ERR => "test: extra argument `-o'\n"}, + ['o', '-o arg', {ERR => "test: extra argument '-o'\n"}, {ERR_SUBST => 's!^.*:!test:!'}, {EXIT => 2}], ); diff --git a/tests/misc/timeout b/tests/misc/timeout index cc1ad3d6e..d69e2f21b 100755 --- a/tests/misc/timeout +++ b/tests/misc/timeout @@ -42,7 +42,7 @@ test $? = 124 || fail=1 timeout -s0 -k1 1 sleep 10 test $? = 124 && fail=1 -# Ensure 'timeout` is immune to parent's SIGCHLD handler +# Ensure 'timeout' is immune to parent's SIGCHLD handler # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh. ( # ash doesn't support "trap '' CHLD"; it knows only signal numbers. diff --git a/tests/misc/tr b/tests/misc/tr index ba6e943c8..89f777757 100755 --- a/tests/misc/tr +++ b/tests/misc/tr @@ -112,7 +112,7 @@ my @Tests = ['rep-3', qw('a[b*513]c' '1[x*]2'), {IN=>'abc'}, {OUT=>'1x2'}], # Another couple octal repeat count tests. ['o-rep-1', qw('[b*08]' '[x*]'), {IN=>''}, {OUT=>''}, {EXIT=>1}, - {ERR=>"$prog: invalid repeat count `08' in [c*n] construct\n"}], + {ERR=>"$prog: invalid repeat count '08' in [c*n] construct\n"}], ['o-rep-2', qw('[b*010]cd' '[a*7]BC[x*]'), {IN=>'bcd'}, {OUT=>'BCx'}], ['esc', qw('a\-z' A-Z), {IN=>'abc-z'}, {OUT=>'AbcBC'}], @@ -141,9 +141,9 @@ my @Tests = # Ensure that these fail. # Prior to 2.0.20, each would evoke a failed assertion. ['empty-eq', qw('[==]' x), {IN=>''}, {OUT=>''}, {EXIT=>1}, - {ERR=>"$prog: missing equivalence class character `[==]'\n"}], + {ERR=>"$prog: missing equivalence class character '[==]'\n"}], ['empty-cc', qw('[::]' x), {IN=>''}, {OUT=>''}, {EXIT=>1}, - {ERR=>"$prog: missing character class name `[::]'\n"}], + {ERR=>"$prog: missing character class name '[::]'\n"}], # Weird repeat counts. ['repeat-bs-9', qw(abc '[b*\9]'), {IN=>'abcd'}, {OUT=>'[b*d'}], diff --git a/tests/misc/tsort b/tests/misc/tsort index 88fcec50a..6f41cc07a 100755 --- a/tests/misc/tsort +++ b/tests/misc/tsort @@ -54,7 +54,7 @@ my @Tests = ['only-one', {IN => {f => ""}}, {IN => {g => ""}}, {EXIT => 1}, - {ERR => "tsort: extra operand `g'\n" + {ERR => "tsort: extra operand 'g'\n" . "Try 'tsort --help' for more information.\n"}], ); diff --git a/tests/misc/tty-eof b/tests/misc/tty-eof index eaaec35c8..d6c4a7714 100755 --- a/tests/misc/tty-eof +++ b/tests/misc/tty-eof @@ -67,7 +67,7 @@ $@ my $exp = new Expect; $exp->log_user(0); $exp->spawn("$cmd 2> $stderr") - or (warn "$ME: cannot run `$cmd': $!\n"), $fail=1, next; + or (warn "$ME: cannot run '$cmd': $!\n"), $fail=1, next; # No input for cut -f2. $cmd =~ /^cut/ or $exp->send("a b\n"); diff --git a/tests/misc/wc-files0-from b/tests/misc/wc-files0-from index ac96c98d4..0f99aeeb6 100755 --- a/tests/misc/wc-files0-from +++ b/tests/misc/wc-files0-from @@ -30,14 +30,14 @@ my @Tests = ( # invalid extra command line argument ['f-extra-arg', '--files0-from=- no-such', {IN=>"a"}, {EXIT=>1}, - {ERR => "$prog: extra operand `no-such'\n" + {ERR => "$prog: extra operand 'no-such'\n" . "file operands cannot be combined with --files0-from\n" . "Try '$prog --help' for more information.\n"} ], # missing input file ['missing', '--files0-from=missing', {EXIT=>1}, - {ERR => "$prog: cannot open `missing' for reading: " + {ERR => "$prog: cannot open 'missing' for reading: " . "No such file or directory\n"}], # input file name of '-' diff --git a/tests/misc/xstrtol b/tests/misc/xstrtol index bdc7bff28..fa0056fcd 100755 --- a/tests/misc/xstrtol +++ b/tests/misc/xstrtol @@ -39,7 +39,7 @@ my @Tests = {ERR=>"$prog: invalid --pages argument 'x'\n"}], ['inv-pg-range', "--pages=9x", {EXIT => 1}, - {ERR=>"$prog: invalid page range `9x'\n"}], + {ERR=>"$prog: invalid page range '9x'\n"}], ); my $save_temps = $ENV{DEBUG}; diff --git a/tests/mv/hard-3 b/tests/mv/hard-3 index 9a7a2a376..1a1f82fff 100755 --- a/tests/mv/hard-3 +++ b/tests/mv/hard-3 @@ -1,5 +1,5 @@ #!/bin/sh -# Ensure that using `cp --preserve=link' to copy hard-linked arguments +# Ensure that using 'cp --preserve=link' to copy hard-linked arguments # onto existing destinations works, even when one of the link operations fails. # Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc. diff --git a/tests/mv/i-1 b/tests/mv/i-1 index 20b6ad7b9..5895137da 100755 --- a/tests/mv/i-1 +++ b/tests/mv/i-1 @@ -30,7 +30,7 @@ my @Tests = # Make sure a 'n' reply to 'mv -i...' aborts the move operation. [$test_a, '-i', {IN => {src => "a\n"}}, {IN => {dst => "b\n"}}, '<', {IN => "n\n"}, - {ERR => "mv: overwrite `dst'? "}, + {ERR => "mv: overwrite 'dst'? "}, {POST => sub { -r 'src' or die "test $test_a failed\n"}}, {EXIT => 0}, ], diff --git a/tests/pr/pr-tests b/tests/pr/pr-tests index de1061225..2a333dc1e 100755 --- a/tests/pr/pr-tests +++ b/tests/pr/pr-tests @@ -334,7 +334,7 @@ my @tv = ( ['14g', '-2 -S -f', [\'t_notab'], [\'2-Sf-t_notab'], 0], # full lines, no truncation / separator = TAB : (Input: -S"") ['14h', '-2 -S" " -J -f', [\'t_notab'], [\'2sf-t_notab'], 0], -# columns, truncated = 72 / separator `:' : +# columns, truncated = 72 / separator ':' : ['14i', '-2 -S: -f', [\'t_notab'], [\'2-S_f-t_notab'], 0], # full lines, no truncation / separator = `:' : ['14j', '-2 -S: -J -f', [\'t_notab'], [\'2s_f-t_notab'], 0], @@ -385,7 +385,7 @@ my @tv = ( ['col-long', '-W3 -t -1 --columns=2', "a\nb\nc\n", "a c\nb\n", 0], # Make sure these fail. ['col-0', '-0', '', '', 1, - "$prog: invalid number of columns: `0'\n"], + "$prog: invalid number of columns: '0'\n"], ['col-inval', '-'.'9'x100, '', '', 1, "$prog: invalid number of columns: `". ('9'x100) ."'\n"], diff --git a/tests/rm/deep-1 b/tests/rm/deep-1 index c3632dd62..ee7ebe338 100755 --- a/tests/rm/deep-1 +++ b/tests/rm/deep-1 @@ -38,7 +38,7 @@ k200=$k20$k20$k20$k20$k20$k20$k20$k20$k20$k20 k_deep=$k200$k200 t=t -# Create a directory in $t with lots of `k' components. +# Create a directory in $t with lots of 'k' components. deep=$t$k_deep mkdir -p $deep || fail=1 diff --git a/tests/rm/empty-name b/tests/rm/empty-name index 192a60b4b..bb8307a50 100755 --- a/tests/rm/empty-name +++ b/tests/rm/empty-name @@ -44,10 +44,10 @@ my @Tests = # test-name options input expected-output # ['empty-name-1', "''", {EXIT => 1}, - {ERR => "$prog: cannot remove `': No such file or directory\n"}], + {ERR => "$prog: cannot remove '': No such file or directory\n"}], ['empty-name-2', "a '' b", {EXIT => 1}, - {ERR => "$prog: cannot remove `': No such file or directory\n"}, + {ERR => "$prog: cannot remove '': No such file or directory\n"}, {PRE => sub { mk_file qw(a b) }}, {POST => sub {-f 'a' || -f 'b' and die "a or b remain\n" }}, ], diff --git a/tests/rm/fail-eperm b/tests/rm/fail-eperm index 0b3e6dc3e..b51cdc77c 100755 --- a/tests/rm/fail-eperm +++ b/tests/rm/fail-eperm @@ -85,7 +85,7 @@ foreach my $dir (@dir_list) # expected exit code and diagnostic. my $cmd = "$rm -f -- $target_file"; open RM, "$cmd 2>&1 |" - or die "$ME: cannot execute `$cmd'\n"; + or die "$ME: cannot execute '$cmd'\n"; my $line = ; @@ -99,27 +99,27 @@ foreach my $dir (@dir_list) if ($rc == 0) { next if ! -e $target_file; - die "$ME: unexpected exit status from `$cmd';\n" + die "$ME: unexpected exit status from '$cmd';\n" . " got 0, expected 1\n"; } if (0x80 < $rc) { my $status = $rc >> 8; $status == 1 - or die "$ME: unexpected exit status from `$cmd';\n" + or die "$ME: unexpected exit status from '$cmd';\n" . " got $status, expected 1\n"; } else { # Terminated by a signal. my $sig_num = $rc & 0x7F; - die "$ME: command `$cmd' died with signal $sig_num\n"; + die "$ME: command '$cmd' died with signal $sig_num\n"; } - my $exp = "rm: cannot remove `$target_file':"; + my $exp = "rm: cannot remove '$target_file':"; $line - or die "$ME: no output from `$cmd';\n" - . "expected something like `$exp ...'\n"; + or die "$ME: no output from '$cmd';\n" + . "expected something like '$exp ...'\n"; # Transform the actual diagnostic so that it starts with "rm:". # Depending on your system, it might be "rm:" already, or @@ -128,7 +128,7 @@ foreach my $dir (@dir_list) my $regex = quotemeta $exp; $line =~ /^$regex/ - or die "$ME: unexpected diagnostic from `$cmd';\n" + or die "$ME: unexpected diagnostic from '$cmd';\n" . " got $line" . " expected $exp ...\n"; diff --git a/tests/rm/no-give-up b/tests/rm/no-give-up index 690c5b617..2644c8afc 100755 --- a/tests/rm/no-give-up +++ b/tests/rm/no-give-up @@ -29,7 +29,7 @@ chown -R $NON_ROOT_USERNAME d || framework_failure_ chmod go=x . || framework_failure_ -# This must fail, since `.' is not writable by $NON_ROOT_USERNAME. +# This must fail, since '.' is not writable by $NON_ROOT_USERNAME. setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm -rf d 2>/dev/null && fail=1 # d must remain. diff --git a/tests/split/lines b/tests/split/lines index 374a32fea..f4db729e5 100755 --- a/tests/split/lines +++ b/tests/split/lines @@ -1,5 +1,5 @@ #!/bin/sh -# show that `split --lines=2' works. +# show that 'split --lines=2' works. # Copyright (C) 2002, 2006-2012 Free Software Foundation, Inc. -- cgit v1.2.3-54-g00ecf