diff options
author | Pádraig Brady <P@draigBrady.com> | 2016-01-08 14:31:27 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2016-01-13 10:59:56 +0000 |
commit | 826c98b02486dd9dbbab3d2381d5f778af42dd7a (patch) | |
tree | 24177f02817887f4ca8e63844e68770086c663ae /tests/misc/tac.pl | |
parent | a499a0ce583a8d941e50c4da450133e694994d17 (diff) | |
download | coreutils-826c98b02486dd9dbbab3d2381d5f778af42dd7a.tar.xz |
tac: support an empty (NUL) --separator
* doc/coreutils.texi (tac invocation): Mention the
NUL delineation with an empty --separator.
* src/tac.c (main): Allow an empty separator when -r not specified.
* tests/misc/tac.pl: Add test cases.
* NEWS: Mention the new feature.
Fixes http://bugs.gnu.org/8103
Diffstat (limited to 'tests/misc/tac.pl')
-rwxr-xr-x | tests/misc/tac.pl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/misc/tac.pl b/tests/misc/tac.pl index 6297b1659..fb7671988 100755 --- a/tests/misc/tac.pl +++ b/tests/misc/tac.pl @@ -45,6 +45,13 @@ my @Tests = ['basic-j', '', {IN=>"1234\n8\n"}, {OUT=>"8\n1234\n"}], ['basic-k', '', {IN=>"123\n8\n"}, {OUT=>"8\n123\n"}], + ['nul-0', '-s ""', {IN=>""}, {OUT=>""}], + ['nul-a', '-s ""', {IN=>"a"}, {OUT=>"a"}], + ['nul-b', '-s ""', {IN=>"\0"}, {OUT=>"\0"}], + ['nul-c', '-s ""', {IN=>"a\0"}, {OUT=>"a\0"}], + ['nul-d', '-s ""', {IN=>"a\0b"}, {OUT=>"ba\0"}], + ['nul-e', '-s ""', {IN=>"a\0b\0"}, {OUT=>"b\0a\0"}], + ['opt-b', '-b', {IN=>"\na\nb\nc"}, {OUT=>"\nc\nb\na"}], ['opt-s', '-s:', {IN=>"a:b:c:"}, {OUT=>"c:b:a:"}], ['opt-sb', qw(-s : -b), {IN=>":a:b:c"}, {OUT=>":c:b:a"}], |