diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2024-12-10 21:01:52 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2024-12-10 21:01:52 +0100 |
commit | 9e364b16d1020cb7b8f8f4d4f3fe1833496b7a12 (patch) | |
tree | b1948da774eeb0f74f9cf6c7b1fc07f35ba41fde /testsuite | |
parent | a208fa03de8467d1f51821f874cbf142aaad74fa (diff) | |
download | busybox-w32-9e364b16d1020cb7b8f8f4d4f3fe1833496b7a12.tar.gz busybox-w32-9e364b16d1020cb7b8f8f4d4f3fe1833496b7a12.tar.bz2 busybox-w32-9e364b16d1020cb7b8f8f4d4f3fe1833496b7a12.zip |
cut: fix -d$'\n' --output-delimiter=@@ behavior
function old new delta
cut_main 1261 1353 +92
packed_usage 34925 34901 -24
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 92/-24) Total: 68 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/cut.tests | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/cut.tests b/testsuite/cut.tests index ba5f88d60..8da390cd7 100755 --- a/testsuite/cut.tests +++ b/testsuite/cut.tests | |||
@@ -116,4 +116,30 @@ testing "cut non-existing field" "cut -d ':' -f1,3" \ | |||
116 | "1\n" \ | 116 | "1\n" \ |
117 | "" "1:\n" | 117 | "" "1:\n" |
118 | 118 | ||
119 | # cut -d$'\n' has a special meaning: "select input lines". | ||
120 | # I didn't find any documentation for this feature. | ||
121 | testing "cut -dNEWLINE" \ | ||
122 | "cut -d' | ||
123 | ' -f4,2,6-8" \ | ||
124 | "2\n4\n6\n7\n" \ | ||
125 | "" "1\n2\n3\n4\n5\n6\n7" | ||
126 | |||
127 | testing "cut -dNEWLINE --output-delimiter" \ | ||
128 | "cut -d' | ||
129 | ' -O@@ -f4,2,6-8" \ | ||
130 | "2@@4@@6@@7\n" \ | ||
131 | "" "1\n2\n3\n4\n5\n6\n7" | ||
132 | |||
133 | testing "cut -dNEWLINE --output-delimiter 2" \ | ||
134 | "cut -d' | ||
135 | ' -O@@ -f4,2,6-8" \ | ||
136 | "2@@4@@6@@7\n" \ | ||
137 | "" "1\n2\n3\n4\n5\n6\n7\n" | ||
138 | |||
139 | testing "cut -dNEWLINE --output-delimiter EMPTY_INPUT" \ | ||
140 | "cut -d' | ||
141 | ' -O@@ -f4,2,6-8" \ | ||
142 | "" \ | ||
143 | "" "" | ||
144 | |||
119 | exit $FAILCOUNT | 145 | exit $FAILCOUNT |