summaryrefslogtreecommitdiff
path: root/tests/fmt
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-01-06 10:42:17 +0100
committerJim Meyering <jim@meyering.net>2007-01-06 10:42:17 +0100
commitbce110cdd584f52f91bd83ba17078e63d8b89841 (patch)
tree8cec4becf91c21532a0eeda6b578894e8c837a6b /tests/fmt
parent37bcc2770788d8fd9fd8cda3413a27dd131d9e22 (diff)
downloadcoreutils-bce110cdd584f52f91bd83ba17078e63d8b89841.tar.gz
coreutils-bce110cdd584f52f91bd83ba17078e63d8b89841.tar.bz2
coreutils-bce110cdd584f52f91bd83ba17078e63d8b89841.zip
* tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
based on examples from G.P. Halkes in <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9388>.
Diffstat (limited to 'tests/fmt')
-rwxr-xr-xtests/fmt/basic12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/fmt/basic b/tests/fmt/basic
index 04938b860..66abe1305 100755
--- a/tests/fmt/basic
+++ b/tests/fmt/basic
@@ -64,6 +64,18 @@ my @Tests =
['pfx-1', qw (-p '>'),
{IN=> " 1\n 2\n\t3\n\t\t4\n> quoted\n> text\n"},
{OUT=> " 1\n 2\n\t3\n\t\t4\n> quoted text\n"}],
+
+ # Don't remove prefix from a prefix-only line.
+ ['pfx-only', qw (-p '>'),
+ {IN=> ">\n"},
+ {OUT=> ">\n"}],
+
+ # With a multi-byte prefix, say, "foo", don't empty a line that
+ # starts with a strict prefix (e.g. "fo") of that prefix.
+ # With fmt from coreutils-6.7, it would mistakenly output an empty line.
+ ['pfx-of-pfx', qw (-p 'foo'),
+ {IN=> "fo\n"},
+ {OUT=> "fo\n"}],
);
my $save_temps = $ENV{DEBUG};