From 64d4a2807d46a85cfe5ab7eb99b3e91b9a75d5ab Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Fri, 23 Nov 2012 03:06:07 +0000 Subject: seq: ensure correct output width for scientific notation input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/seq.c (scan_arg): Calculate the width more accurately for numbers specified using scientific notation. * tests/misc/seq.pl: Add tests for cases that were mishandled. * NEWS: Mention the fix. * THANKS.in: Reported by Marcel Böhme. Fixes http://bugs.gnu.org/12959 --- tests/misc/seq.pl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/misc/seq.pl b/tests/misc/seq.pl index 351097b70..447baa4b3 100755 --- a/tests/misc/seq.pl +++ b/tests/misc/seq.pl @@ -70,6 +70,13 @@ my @Tests = ['eq-wid-6', qw(-w +1 2), {OUT => [qw(1 2)]}], ['eq-wid-7', qw(-w " .1" " .1"), {OUT => [qw(0.1)]}], ['eq-wid-8', qw(-w 9 0.5 10), {OUT => [qw(09.0 09.5 10.0)]}], + # Prior to 8.21, these tests involving numbers in scentific notation + # would fail with misalignment or wrong widths. + ['eq-wid-9', qw(-w -1e-3 1), {OUT => [qw(-0.001 00.999)]}], + ['eq-wid-10',qw(-w -1e-003 1), {OUT => [qw(-0.001 00.999)]}], + ['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 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)]}], -- cgit v1.2.3-54-g00ecf