From: Sylvestre Ledru <[email protected]>

* tests/fmt/base.pl (tagged-1, tagged-2, tagged-3, tagged-4, tagged-5):
New tests, checking the indent of the continuation lines of a
one-line tagged paragraph, with and without a prefix.

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

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

diff --git a/tests/fmt/base.pl b/tests/fmt/base.pl
index b8eca2d53..1c023397f 100755
--- a/tests/fmt/base.pl
+++ b/tests/fmt/base.pl
@@ -73,6 +73,20 @@ my @Tests =
      ['pfx-no-nl-8', "-p '#'",
       {IN=> {f1=> "a\nmixed"}}, {IN=> {f2=> "hello\n"}},
       {OUT=> "a\nmixedhello\n"}],
+
+     # With -t, the indent of a one-line paragraph's continuation lines
+     # differs from that of its first line.
+     ['tagged-1', '-t -w10', {IN=> "ab cd ef gh ij kl mn\n"},
+      {OUT=> "ab cd ef\n   gh ij\n   kl mn\n"}],
+     ['tagged-2', '-t -w10', {IN=> "  ab cd ef gh ij kl mn\n"},
+      {OUT=> "  ab cd\nef gh ij\nkl mn\n"}],
+     ['tagged-3', "-t -w10 -p '#'", {IN=> "#ab cd ef gh ij kl mn\n"},
+      {OUT=> "#ab cd\n#ef gh ij\n#kl mn\n"}],
+     ['tagged-4', "-t -w12 -p '# '", {IN=> "# ab cd ef gh ij kl mn\n"},
+      {OUT=> "# ab cd ef\n#gh ij kl mn\n"}],
+     # A second line sets the indent.
+     ['tagged-5', '-t -w10', {IN=> "ab cd ef gh\n  ij kl mn op qr\n"},
+      {OUT=> "ab cd ef\n  gh ij kl\n  mn op qr\n"}],
 );
 
 my $save_temps = $ENV{DEBUG};
-- 
2.56.0


Reply via email to