]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
seq: add another test for the %% bug
authorJim Meyering <meyering@redhat.com>
Sat, 3 Nov 2007 09:10:38 +0000 (10:10 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 3 Nov 2007 09:42:52 +0000 (10:42 +0100)
* tests/misc/seq (fmt-c): Test the other fixed case, too.

ChangeLog
tests/misc/seq

index ed47c24460efaaa68a051eb98a6f5d64d84f3321..4d931f3c36caae8b4e9370c1a2d2f44b887de579 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-03  Jim Meyering  <meyering@redhat.com>
+
+       seq: add another test for the %% bug.
+       * tests/misc/seq (fmt-c): Test the other fixed case, too.
+
 2007-11-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix bug with "seq 10.8 0.1 10.95", plus another bug with %% in format.
index 73f41336d4c001bce729f70979771f87bd1f27d0..ec843bcf06578b0476b9338b961bd363f8e89801 100755 (executable)
@@ -36,6 +36,8 @@ use strict;
 # Turn off localisation of executable's ouput.
 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
 
+my $prog = 'seq';
+
 my @Tests =
   (
    ['onearg-1',        qw(10),         {OUT => [(1..10)]}],
@@ -80,6 +82,12 @@ my @Tests =
    ['fmt-9',   '-f "% -3.0f"', qw(-1 0), {OUT => ['-1 ', ' 0 ']}],
    ['fmt-a',   '-f "% -.0f"',qw(-1 0), {OUT => ['-1', ' 0']}],
    ['fmt-b',   qw(-f %%%g%% 1),        {OUT => ['%1%']}],
+
+   # In coreutils-[6.0..6.9], this would mistakenly succeed and print "%Lg".
+   ['fmt-c',   qw(-f %%g 1), {EXIT => 1},
+    {ERR => "seq: invalid format string: `%%g'\n"
+     . "Try `seq --help' for more information.\n"},
+],
   );
 
 # Append a newline to each entry in the OUT array.
@@ -96,7 +104,6 @@ foreach $t (@Tests)
 
 my $save_temps = $ENV{SAVE_TEMPS};
 my $verbose = $ENV{VERBOSE};
-my $prog = 'seq';
 
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;