summaryrefslogtreecommitdiff
path: root/tests/fmt/basic
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fmt/basic')
-rwxr-xr-xtests/fmt/basic30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/fmt/basic b/tests/fmt/basic
index 77682f103..66abe1305 100755
--- a/tests/fmt/basic
+++ b/tests/fmt/basic
@@ -2,7 +2,7 @@
# -*- perl -*-
# Basic tests for "fmt".
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -60,23 +60,23 @@ my @Tests =
. " 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.
+ # With --prefix=P, do not remove leading space 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"}],
+ {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"}],
- );
+ # 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};
my $verbose = $ENV{VERBOSE};