summaryrefslogtreecommitdiff
path: root/tests/misc/sort
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-01-07 20:55:10 +0100
committerJim Meyering <meyering@redhat.com>2012-01-09 21:50:08 +0100
commitae2b0d2ddca458eb282bb0458987e75e1875a659 (patch)
treede928bfafb577a20963be45b4b6d97488c0b5e24 /tests/misc/sort
parentdd0e4c5621ca2fa9255aef4eee0e7cf41cd335d2 (diff)
downloadcoreutils-ae2b0d2ddca458eb282bb0458987e75e1875a659.tar.xz
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'\'';'\
Diffstat (limited to 'tests/misc/sort')
-rwxr-xr-xtests/misc/sort26
1 files changed, 13 insertions, 13 deletions
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'",