From 76f606a9544bd67629bd4766ff6efe8bf42b20d9 Mon Sep 17 00:00:00 2001 From: Pádraig Brady
Date: Wed, 19 Dec 2012 19:27:10 +0000 Subject: seq: fix newline output when -s specified This regression was introduced in commit v8.19-132-g3786fb6. * src/seq.c (seq_fast): Don't use puts() to output the first number, and instead insert it into the buffer as for other numbers. Also output the terminator unconditionally. * tests/misc/seq.pl: Add some basic tests for the -s option. * NEWS: Mention the fix. * THANKS.in: Reported by Philipp Gortan. --- tests/misc/seq.pl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/misc/seq.pl b/tests/misc/seq.pl index 447baa4b3..416b839b6 100755 --- a/tests/misc/seq.pl +++ b/tests/misc/seq.pl @@ -128,6 +128,11 @@ my @Tests = ['long-leading-zeros2', qw(000 02), {OUT => [qw(0 1 2)]}], ['long-leading-zeros3', qw(00 02), {OUT => [qw(0 1 2)]}], ['long-leading-zeros4', qw(0 02), {OUT => [qw(0 1 2)]}], + + # Exercise the -s option, which was broken in 8.20 + ['sep-1', qw(-s, 1 3), {OUT => [qw(1,2,3)]}], + ['sep-2', qw(-s, 1 1), {OUT => [qw(1)]}], + ['sep-3', qw(-s,, 1 3), {OUT => [qw(1,,2,,3)]}], ); # Append a newline to each entry in the OUT array. -- cgit v1.2.3-70-g09d2