summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBo Borgerson <gigabo@gmail.com>2008-04-22 23:47:42 -0400
committerJim Meyering <meyering@redhat.com>2008-06-12 21:03:05 +0200
commit81d0c8f367c89a52e41bbd89e7c45d2b1ac495f2 (patch)
treeea8d5e7931701cce737d522cb0c662a6801eb033 /tests
parent98a96822d9dac92de719fa340fe326e1fe0427fe (diff)
downloadcoreutils-81d0c8f367c89a52e41bbd89e7c45d2b1ac495f2.tar.xz
comm: accept new option: --output-delimiter=STR
* src/comm.c (delimiter): New global. (writeline): Use delimiter string instead of single TAB character. (main): Initialize delimiter. * tests/misc/comm: Add tests for comm output delimiter specification. * doc/coreutils.texi: Document new option. * NEWS: Advertise new option. * TODO: Remove associated item.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/comm21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/misc/comm b/tests/misc/comm
index 39557d2c1..81a852944 100755
--- a/tests/misc/comm
+++ b/tests/misc/comm
@@ -115,6 +115,27 @@ my @Tests =
{EXIT=>1},
{OUT => "\t\t2\n"},
{ERR => "$prog: file 1 is not in sorted order\n"}],
+
+ # alternate delimiter: ','
+ ['delim-comma', '--output-delimiter=,', @inputs,
+ {OUT=>"1\n,2\n,,3\n"} ],
+
+ # two-character alternate delimiter: '++'
+ ['delim-2char', '--output-delimiter=++', @inputs,
+ {OUT=>"1\n++2\n++++3\n"} ],
+
+ # invalid empty delimiter
+ ['delim-empty', '--output-delimiter=', @inputs, {EXIT=>1},
+ {ERR => "$prog: empty `--output-delimiter' not allowed\n"}],
+
+ # invalid dual delimiter
+ ['delim-dual', '--output-delimiter=,', '--output-delimiter=+',
+ @inputs, {EXIT=>1}, {ERR => "$prog: multiple delimiters specified\n"}],
+
+ # valid dual delimiter specification
+ ['delim-dual2', '--output-delimiter=,', '--output-delimiter=,', @inputs,
+ {OUT=>"1\n,2\n,,3\n"} ],
+
);
my $save_temps = $ENV{DEBUG};