summaryrefslogtreecommitdiff
path: root/tests/misc
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-01-09 12:23:35 +0000
committerPádraig Brady <P@draigBrady.com>2013-01-26 02:35:58 +0000
commit326e5855bc8dd3d0c5b2c0e461c65879d2b5694d (patch)
tree283b502b0acaa235fab9ac8cbaf7ba49b2f32ee4 /tests/misc
parentd302aed182d625281fba87aca3cb513882aa967b (diff)
downloadcoreutils-326e5855bc8dd3d0c5b2c0e461c65879d2b5694d.tar.xz
seq: fix misaligment with -w when no precision for start value
* src/seq.c (get_default_format): Also account for the case where '.' is auto added to the start value, which is significant when the number sequence narrows. * tests/misc/seq.pl: Add two new tests for the failing cases. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/13394
Diffstat (limited to 'tests/misc')
-rwxr-xr-xtests/misc/seq.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/misc/seq.pl b/tests/misc/seq.pl
index 40a75714d..64c62b2bc 100755
--- a/tests/misc/seq.pl
+++ b/tests/misc/seq.pl
@@ -77,6 +77,10 @@ my @Tests =
['eq-wid-11',qw(-w -1.e-3 1), {OUT => [qw(-0.001 00.999)]}],
['eq-wid-12',qw(-w -1.0e-4 1), {OUT => [qw(-0.00010 00.99990)]}],
['eq-wid-13',qw(-w 999 1e3), {OUT => [qw(0999 1000)]}],
+ # Prior to 8.21, if the start value hadn't a precision, while step did,
+ # then misalignment would occur if the sequence narrowed.
+ ['eq-wid-14',qw(-w -1 1.0 0), {OUT => [qw(-1.0 00.0)]}],
+ ['eq-wid-15',qw(-w 10 -.1 9.9), {OUT => [qw(10.0 09.9)]}],
# Prior to coreutils-4.5.11, some of these were not accepted.
['fmt-1', qw(-f %2.1f 1.5 .5 2),{OUT => [qw(1.5 2.0)]}],