From 4f3ff2e7007a6591294e1a656782b5f239f9840c Mon Sep 17 00:00:00 2001 From: Steven Schubiger Date: Mon, 18 Feb 2008 22:39:22 +0100 Subject: seq: give better diagnostics for invalid formats. * src/seq.c: (validate_format): New function. (main): Use it. * tests/misc/seq (fmt-d, fmt-e): Test for expected diagnostics with invalid formats. * NEWS: Mention this change. * TODO: Remove this item. [jm: src/seq.c: make diagnostics more consistent tests/misc/seq (fmt-eos1): adjust the expected diagnostic ] --- tests/misc/seq | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/misc/seq') diff --git a/tests/misc/seq b/tests/misc/seq index 1a153a310..f48289bdf 100755 --- a/tests/misc/seq +++ b/tests/misc/seq @@ -87,10 +87,14 @@ my @Tests = # "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: invalid format string: `%'\n" . $try_help }], + {ERR => "seq: no % directive in format string `%'\n" . $try_help }], ['fmt-eos2', qw(-f %g% 1), {EXIT => 1}, {ERR => "seq: invalid format string: `%g%'\n" . $try_help }], + ['fmt-d', qw(-f "" 1), {EXIT => 1}, + {ERR => "seq: no % directive in format string `'\n" . $try_help }], + ['fmt-e', qw(-f %g%g 1), {EXIT => 1}, + {ERR => "seq: too many % directives in format string `%g%g'\n"}], ); # Append a newline to each entry in the OUT array. -- cgit v1.2.3-54-g00ecf