From: Sylvestre Ledru <[email protected]>

* tests/expand/expand.pl (f4, f5): New tests, for a line that
continues into the next file.
(long-1, long-2): New tests, for a line longer than a read buffer.

https://github.com/uutils/coreutils/pull/16346

Link: https://github.com/coreutils/coreutils/pull/467
---
 tests/expand/expand.pl | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/expand/expand.pl b/tests/expand/expand.pl
index ee186e317..7ce3bc409 100755
--- a/tests/expand/expand.pl
+++ b/tests/expand/expand.pl
@@ -19,6 +19,7 @@
 use strict;
 
 my $limits = getlimits ();
+my $IO_BUFSIZE = $limits->{IO_BUFSIZE};
 my $UINTMAX_OFLOW = $limits->{UINTMAX_OFLOW};
 
 (my $program_name = $0) =~ s|.*/||;
@@ -75,6 +76,19 @@ my @Tests =
    ['f3', '--tabs=4',
     {IN=>{"in1" => "a\tb\n"}}, {IN=>{"in2" => ""}},
     {OUT=>"a   b\n"}],
+   # A line continues into the next file.
+   ['f4', '',
+    {IN=>{"in1" => "a"}}, {IN=>{"in2" => "\tb\n"}},
+    {OUT=>"a       b\n"}],
+   ['f5', '-i',
+    {IN=>{"in1" => "a"}}, {IN=>{"in2" => "\tb\n"}},
+    {OUT=>"a\tb\n"}],
+   # The column is kept across read buffers.
+   ['long-1', '-t3', {IN=>("a" x $IO_BUFSIZE) . "bcd\tx\n"},
+    {OUT=>("a" x $IO_BUFSIZE) . "bcd"
+          . (" " x (3 - $IO_BUFSIZE % 3)) . "x\n"}],
+   ['long-2', '-i', {IN=>"a" . (" " x ($IO_BUFSIZE - 1)) . "\tx\n"},
+    {OUT=>"a" . (" " x ($IO_BUFSIZE - 1)) . "\tx\n"}],
 
 
    # Test '\b' (back-space) - subtract one column.
-- 
2.56.0


Reply via email to