summaryrefslogtreecommitdiff
path: root/tests/misc/printf-cov.pl
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-10-27 13:13:59 +0000
committerPádraig Brady <P@draigBrady.com>2015-10-27 17:24:54 +0000
commit6796698c9945d87236ffcc939137d0919ef04931 (patch)
treedd843e7808186887c2959451e34fdd7f42783359 /tests/misc/printf-cov.pl
parent106d4bf159a97b573d6479473fa38216fb8bfada (diff)
downloadcoreutils-6796698c9945d87236ffcc939137d0919ef04931.tar.xz
all: quote string arguments in error messages
These strings are often file names or other user specified parameters, which can give confusing errors in the presence of unexpected characters for example. * cfg.mk (sc_error_quotes): A new syntax check rule. * src/*.c: Wrap error() string arguments with quote(). * tests/: Adjust accordingly. * NEWS: Mention the improvement.
Diffstat (limited to 'tests/misc/printf-cov.pl')
-rwxr-xr-xtests/misc/printf-cov.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/misc/printf-cov.pl b/tests/misc/printf-cov.pl
index 4be979718..eb4adf3bd 100755
--- a/tests/misc/printf-cov.pl
+++ b/tests/misc/printf-cov.pl
@@ -46,9 +46,9 @@ my @Tests =
['d-vwvp', '%*.*d 3 2 15', {OUT=>" 15"}],
['d-neg-prec', '%.*d -3 15', {OUT=>"15"}],
['d-big-prec', "%.*d $pow_2_31 15", # INT_MAX
- {EXIT=>1}, {ERR=>"$prog: invalid precision: $pow_2_31\n"}],
+ {EXIT=>1}, {ERR=>"$prog: invalid precision: '$pow_2_31'\n"}],
['d-big-fwidth', "%*d $pow_2_31 15", # INT_MAX
- {EXIT=>1}, {ERR=>"$prog: invalid field width: $pow_2_31\n"}],
+ {EXIT=>1}, {ERR=>"$prog: invalid field width: '$pow_2_31'\n"}],
['F', '%F 1', {OUT=>"1.000000"}],
['LF', '%LF 1', {OUT=>"1.000000"}],
['E', '%E 2', {OUT=>"2.000000E+00"}],
@@ -76,12 +76,12 @@ my @Tests =
# no-num: Invalid argument (FreeBSD6)
# no-num: expected a numeric value (glibc, Solaris 10)
{ERR_SUBST => 's/Invalid argument$/expected a numeric value/'},
- {ERR=>"$prog: no-num: expected a numeric value\n"}],
+ {ERR=>"$prog: 'no-num': expected a numeric value\n"}],
['d-bad-suffix', '%d 9z', {OUT=>'9'}, {EXIT=>1},
- {ERR=>"$prog: 9z: value not completely converted\n"}],
+ {ERR=>"$prog: '9z': value not completely converted\n"}],
['d-out-of-range', '%d '.('9'x30), {EXIT=>1},
{OUT=>"inaccurate"}, {OUT_SUBST => 's/\d+/inaccurate/'},
- {ERR=>"$prog: 9...9\n"}, {ERR_SUBST => 's/9+.*/9...9/'}],
+ {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"}],
['percent', '%%', {OUT=>'%'}],