diff options
author | Pádraig Brady <P@draigBrady.com> | 2016-01-08 15:42:56 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2016-01-13 10:59:56 +0000 |
commit | 0e46753d7c9519d7378cd3a4e0951a36ac32ffe7 (patch) | |
tree | ec8de30ef6b0ef37cf149f11c1c690d1dc4c66ae /tests | |
parent | f3b4def577c4eee22f83b72d1310aa1d9155908d (diff) | |
download | coreutils-0e46753d7c9519d7378cd3a4e0951a36ac32ffe7.tar.xz |
comm: support NUL --output-delimiter for consistency
* src/comm.c (main): Track the output delimiter length,
so that it can be adjusted to 1 for the NUL delimiter.
Also rename the global variable from "delimiter" to
"col_sep" so its use is more obvious, and to distinguish
from the recently added "delim" global variable.
* tests/misc/comm.pl: Adjust accordingly.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/comm.pl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/misc/comm.pl b/tests/misc/comm.pl index 3232d6339..c5cd27f39 100755 --- a/tests/misc/comm.pl +++ b/tests/misc/comm.pl @@ -134,13 +134,15 @@ my @Tests = ['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"}], + # NUL delimiter + ['delim-empty', '--output-delimiter=', @inputs, + {OUT=>"1\n\0002\n\000\0003\n"} ], + ['zdelim-empty', '-z', '-z --output-delimiter=', @zinputs, + {OUT=>"1\000\0002\000\000\0003\000"} ], # invalid dual delimiter - ['delim-dual', '--output-delimiter=,', '--output-delimiter=+', - @inputs, {EXIT=>1}, {ERR => "$prog: multiple delimiters specified\n"}], + ['delim-dual', '--output-delimiter=,', '--output-delimiter=+', @inputs, + {EXIT=>1}, {ERR => "$prog: multiple output delimiters specified\n"}], # valid dual delimiter specification ['delim-dual2', '--output-delimiter=,', '--output-delimiter=,', @inputs, |