From a499a0ce583a8d941e50c4da450133e694994d17 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Fri, 8 Jan 2016 13:04:03 +0000 Subject: 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. --- tests/misc/cut.pl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') 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"}], -- cgit v1.2.3-54-g00ecf