summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2016-01-08 13:04:03 +0000
committerPádraig Brady <P@draigBrady.com>2016-01-13 10:59:56 +0000
commita499a0ce583a8d941e50c4da450133e694994d17 (patch)
treeb6700e72ac92627c8308728ba883c2f78f5f9fe0 /tests
parentbc94551f63cfc4c05a56628dfcb386707d9e98cb (diff)
downloadcoreutils-a499a0ce583a8d941e50c4da450133e694994d17.tar.xz
cut: add the -z,--zero-terminated option
* doc/coreutils.texi (cut invocation): Reference the description. * src/cut.c: Parameterize '\n' references. * tests/misc/cut.pl: Add tests for character and field processing. * NEWS: Mention the new feature.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/cut.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/misc/cut.pl b/tests/misc/cut.pl
index 70c5a642a..f6f8a5611 100755
--- a/tests/misc/cut.pl
+++ b/tests/misc/cut.pl
@@ -161,6 +161,14 @@ my @Tests =
['newline-23', "-d'\n'", '-f1-', '--ou=:', {IN=>"a\nb\n"}, {OUT=>"a:b\n"}],
['newline-24', "-d'\n'", '-f1,2', '--ou=:', {IN=>"a\nb\n"}, {OUT=>"a:b\n"}],
+ # --zero-terminated
+ ['zerot-1', "-z", '-c1', {IN=>"ab\0cd\0"}, {OUT=>"a\0c\0"}],
+ ['zerot-2', "-z", '-c1', {IN=>"ab\0cd"}, {OUT=>"a\0c\0"}],
+ ['zerot-3', '-z -f1-', {IN=>""}, {OUT=>""}],
+ ['zerot-4', '-z -d:', '-f1', {IN=>"a:1\0b:2"}, {OUT=>"a\0b\0"}],
+ ['zerot-5', '-z -d:', '-f1-', {IN=>"a1:\0:"}, {OUT=>"a1:\0:\0"}],
+ ['zerot-6', "-z -d ''", '-f1,2', '--ou=:', {IN=>"a\0b\0"}, {OUT=>"a:b\0"}],
+
# New functionality:
['out-delim1', '-c1-3,5-', '--output-d=:', {IN=>"abcdefg\n"},
{OUT=>"abc:efg\n"}],