summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2016-01-08 15:57:06 +0000
committerPádraig Brady <P@draigBrady.com>2016-01-13 10:59:56 +0000
commit8297568ec60103d95a56cf142d534f215086fe2b (patch)
tree0bf21e532d6be6d2e7989a2872b5c24a3a0bd5b0 /tests
parent0e46753d7c9519d7378cd3a4e0951a36ac32ffe7 (diff)
downloadcoreutils-8297568ec60103d95a56cf142d534f215086fe2b.tar.xz
paste: add the -z,--zero-terminated option
* doc/coreutils.texi (paste invocation): Reference -z description. * src/paste.c (main): Parameterize the use of '\n'. * tests/misc/paste.pl: Add test cases. * NEWS: Mention the new feature.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/paste.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/misc/paste.pl b/tests/misc/paste.pl
index b4409e779..7c9559700 100755
--- a/tests/misc/paste.pl
+++ b/tests/misc/paste.pl
@@ -34,6 +34,11 @@ my @Tests =
['no-nl-3', {IN=>"a"}, {IN=>"b\n"}, {OUT=>"a\tb\n"}],
['no-nl-4', {IN=>"a\n"}, {IN=>"b\n"}, {OUT=>"a\tb\n"}],
+ ['zno-nl-1', '-z', {IN=>"a"}, {IN=>"b"}, {OUT=>"a\tb\0"}],
+ ['zno-nl-2', '-z', {IN=>"a\0"}, {IN=>"b"}, {OUT=>"a\tb\0"}],
+ ['zno-nl-3', '-z', {IN=>"a"}, {IN=>"b\0"}, {OUT=>"a\tb\0"}],
+ ['zno-nl-4', '-z', {IN=>"a\0"}, {IN=>"b\0"}, {OUT=>"a\tb\0"}],
+
# Same as above, but with a two lines in each input file and
# the addition of the -d option to make SPACE be the output delimiter.
['no-nla1', '-d" "', {IN=>"1\na"}, {IN=>"2\nb"}, {OUT=>"1 2\na b\n"}],
@@ -41,6 +46,11 @@ my @Tests =
['no-nla3', '-d" "', {IN=>"1\na"}, {IN=>"2\nb\n"}, {OUT=>"1 2\na b\n"}],
['no-nla4', '-d" "', {IN=>"1\na\n"}, {IN=>"2\nb\n"}, {OUT=>"1 2\na b\n"}],
+ ['zno-nla1', '-zd" "', {IN=>"1\0a"}, {IN=>"2\0b"}, {OUT=>"1 2\0a b\0"}],
+ ['zno-nla2', '-zd" "', {IN=>"1\0a\0"}, {IN=>"2\0b"}, {OUT=>"1 2\0a b\0"}],
+ ['zno-nla3', '-zd" "', {IN=>"1\0a"}, {IN=>"2\0b\0"}, {OUT=>"1 2\0a b\0"}],
+ ['zno-nla4', '-zd" "', {IN=>"1\0a\0"}, {IN=>"2\0b\0"}, {OUT=>"1 2\0a b\0"}],
+
# Specifying a delimiter with a trailing backslash would overrun a
# malloc'd buffer.
['delim-bs1', q!-d'\'!, {IN=>{'a'x50=>''}}, {EXIT => 1},