aboutsummaryrefslogtreecommitdiff
path: root/testsuite/cut.tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
* cut: fix up -D/-s behavior with -FDenys Vlasenko2024-12-201-2/+33
| | | | | | | | | | function old new delta cut_main 1388 1402 +14 packed_usage 34934 34933 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-1) Total: 13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cut: fix -F n-m to match toyboxDenys Vlasenko2024-12-141-3/+18
| | | | | | | function old new delta cut_main 1339 1391 +52 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cut: fix handling of -d ''Denys Vlasenko2024-12-131-0/+12
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cut: fix -d$'\n' --output-delimiter=@@ behaviorDenys Vlasenko2024-12-101-0/+26
| | | | | | | | | | 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>
* cut: implement --output-delimiterDenys Vlasenko2024-12-101-8/+24
| | | | | | | | | | function old new delta cut_main 1204 1261 +57 static.cut_longopts - 20 +20 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 77/0) Total: 77 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cut: fix "echo 1.2 | cut -d. -f1,3" (print "1", not "1.")Denys Vlasenko2024-12-101-2/+9
| | | | | | | function old new delta cut_main 1228 1201 -27 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cut: improve detection of invalid rangesRon Yorston2024-12-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0068ce2fa (cut: add toybox-compatible options -O OUTSEP, -D, -F LIST) added detection of reversed ranges. Further improvements are possible. - The test for reversed ranges compared the start after it had been decremented with the end before decrement. It thus missed ranges of the form 2-1. - Zero isn't a valid start value for a range. (Nor is it a valid end value, but that's caught by the test for a reversed range.) - The code if (!*ltok) e = INT_MAX; duplicates a check that's already been made. - Display the actual range in the error message to make it easier to find which range was at fault. function old new delta .rodata 100273 100287 +14 cut_main 1239 1237 -2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-2) Total: 12 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cut: fix "-s" flag to omit blank linesColin McAllister2024-12-101-0/+9
| | | | | | | | | | | | | | | | | | Using cut with the delimiter flag ("-d") with the "-s" flag to only output lines containing the delimiter will print blank lines. This is deviant behavior from cut provided by GNU Coreutils. Blank lines should be omitted if "-s" is used with "-d". This change introduces a somewhat naiive, yet efficient solution, where line length is checked before looping though bytes. If line length is zero and the "-s" flag is used, the code will jump to parsing the next line to avoid printing a newline character. function old new delta cut_main 1196 1185 -11 Signed-off-by: Colin McAllister <colinmca242@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cut: fix testsuiteDenys Vlasenko2021-08-151-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cut: add toybox-compatible options -O OUTSEP, -D, -F LISTRob Landley2021-07-201-0/+64
| | | | | | | | | | | | function old new delta cut_main 884 1201 +317 packed_usage 33823 33885 +62 .rodata 104186 104179 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 379/-7) Total: 372 bytes Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tests: fix POSIX shell source styleMike Frysinger2009-11-041-1/+1
| | | | | | | The source command does not search $PWD, and bash recently fixed itself to follow this behavior for /bin/sh. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fix vda's testsuite bogons, part 2Denis Vlasenko2007-11-261-0/+18
|
* fix vda's testsuite bogons, part 1Denis Vlasenko2007-11-261-19/+0
|
* testsuite: add tests for cut and grep;Denis Vlasenko2007-11-261-0/+19
slight improvements to infrastructure