]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(pfx-1, pfx-2): New tests, to demonstrate the bug
authorJim Meyering <jim@meyering.net>
Thu, 19 Jan 2006 20:58:22 +0000 (20:58 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 19 Jan 2006 20:58:22 +0000 (20:58 +0000)
reported as http://bugs.debian.org/147577.  Forwarded by Thomas Hood.

tests/fmt/basic

index 7d8916efd7f5421cf992e4a5d8d097f366b904a7..ad536d1168b5447dd022520ea349cd4d926a9f50 100755 (executable)
@@ -40,6 +40,23 @@ my @Tests =
       {ERR => "fmt: invalid option -- 7; -WIDTH is recognized only when it"
        . " is the first\noption; use -w N instead\n"
        . "Try `fmt --help' for more information.\n" }, {EXIT => 1}],
+
+     # With --prefix=P, Do not remove leading on lines without the prefix.
+     ['pfx-1', qw (-p '>'),
+      {IN=>  " 1\n  2\n\t3\n\t\t4\n> quoted\n> text\n"},
+      # This is the buggy output (leading white space removed),
+      # from coreutils-5.93.
+      {OUT=> "1\n2\n3\n4\n> quoted text\n"}],
+      # FIXME: this is the desired output
+      # {OUT=> " 1\n  2\n\t3\n\t\t4\n> quoted text\n"}],
+
+     # Like the above, but when two adjacent, non-prefixed lines have
+     # the same indentation, ensure that they are formatted.
+     ['pfx-2', qw (-p '>'),
+      {IN=>  " 1\n 2\n\t3\n\t4\n"},
+      {OUT=> "1\n2\n3\n4\n"}],
+      # FIXME: this is the desired output
+      # {OUT=> " 1 2\n\t3 4\n"}],
     );
 
 my $save_temps = $ENV{DEBUG};