summaryrefslogtreecommitdiffstats
path: root/tests/cut
AgeCommit message (Collapse)AuthorLines
2026-04-15tests: avoid $SHELL -c "ulimit ..." patternPádraig Brady-5/+3
As described in commit v9.10-283-g5cb0cca3b avoid using ulimit with $SHELL -c, and explict invocation of the shell like that can require lots of memory, often due to loading the locale archive. * tests/basenc/bounded-memory.sh: Avoid $SHELL -c with ulimit. * tests/cut/bounded-memory.sh: Likewise. * tests/expand/bounded-memory.sh Likewise. * tests/pr/bounded-memory.sh Likewise. * tests/unexpand/bounded-memory.sh Likewise. * tests/fold/fold-zero-width.sh: Bring the ulimit bound down to the standard 6M over the determined limit.
2026-04-06tests: cut: add remaining tests to ensure 100% coveragePádraig Brady-0/+14
* tests/cut/cut.pl: Add new tests to ensure `make coverage` shows 100% coverage for cut.c.
2026-04-06tests: cut: expand GB18030 testsPádraig Brady-1/+48
* tests/cut/mb-non-utf8.sh: Add more test cases.
2026-04-06cut: -f: fix handling of multi-byte delimiters that span buffersPádraig Brady-0/+3
* src/cut.c (cut_fields_bytesearch): Ensure up to delim_bytes -1 is left for the next refill. * tests/cut/cut.pl: Add a test case.
2026-04-05cut: fix logic issue with field delim in last byte of bufferPádraig Brady-0/+5
With field delimiter = line delimiter we need to know if there is any more data to be read, as field delimiter in the last byte of the file is treated differently. So reiterate the loop to ensure enough read()s to make the appropriate determination.
2026-04-05tests: cut: add more multi-byte testsPádraig Brady-0/+73
* tests/cut/cut.pl: Add more multi-byte combinations.
2026-04-05cut: optimize UTF-8 input with 0xF5-0xFF delimitersPádraig Brady-0/+3
* src/cut.c (bytesearch_field_delim_ok): Expand the range of bytes that can be simply searched for. 0xF5-0xFF can't appear in valid UTF-8 characters, and so may be used as delimiters in UTF-8 input, so it's worth optimizing for. * tests/cut/cut.pl: Add a test case (mainly as documentation).
2026-04-05cut: optimize when no delimiter in inputPádraig Brady-0/+1
This is about 20x faster. Note we only do the delimiter search once per chunk, and it's usually quick as delimiters wouldn't be too far into the a chunk if present, so we don't bother to cache the found delimiter.
2026-04-05tests: cut: ensure multi-byte delimiter is rejected in uni-byte localesPádraig Brady-0/+19
tests/cut/cut.pl: Check the appropriate diagnostic is presented.
2026-04-05cut: merge cut_fields and cut_fields_bytesearchPádraig Brady-0/+2
TODO: See why this is much slower: time LC_ALL=C.UTF-8 src/cut -f1 -dc as.in > /dev/null
2026-04-05cut: faster utf8 processingPádraig Brady-0/+6
TODO: improve to use bounded memory where possible
2026-04-05cut: support -F as an alias for -f -w -O ' 'Pádraig Brady-0/+3
To improve compatibility with toybox/busybox scripts.
2026-04-05cut: support --whitespace-delimited=trimmedPádraig Brady-0/+6
Support ignoring leading and trailing whitespace. E.g. this matches awk's default field splitting mode. * src/cut.c * tests/cut/cut.pl: Add test cases.
2026-04-05cut: support -O as an alias for --output-delimiterPádraig Brady-2/+1
To improve compatibility with toybox/busybox scripts. * doc/coreutils.texi (cut invocation): Add -O description. * src/cut.c: Support -O as well as --output-delimiter * tests/cut/cut.pl: Adjust one case to use -O.
2026-04-05cut: implement -n to avoid outputting partial charactersPádraig Brady-0/+23
Both the i18n patch and FreeBSD/macOS support this option. They do differ in behavior somewhat as the i18n patch may output more bytes than requested. $ printf '\xc3\xa9b\n' | i18n-cut -n -b1 é There is also a bug in the i18n patch with multi-byte at the start of a line: $ printf '\xc3\xa9b\n' | i18n-cut -n -b1-2 éb We follow the FreeBSD behavior since it seems more useful to have -b be a hard limit, rather than a soft limit. This also reduces the possibility of duplicate character output with separate cut invocations with non overlapping byte ranges. * src/cut.c (cut_bytes_no_split): A new function similar to cut_characters, to handle multi-byte characters with byte limit semantics. * tests/cut/cut.pl: Add test cases.
2026-04-05tests: cut: add a test for divergence from i18n patchPádraig Brady-0/+3
* tests/cut/cut.pl: We don't fall back to byte mode upon invalid uni-byte delimiter.
2026-04-05tests: cut: add case currently failing for coreutils-i18n patchPádraig Brady-0/+3
* tests/cut/cut.pl: Test for extraneous character output with: printf 'aéb\n' | cut -s -d 'é' -f1 | od -tx1
2026-04-05tests: cut: check multi-byte output delimiterPádraig Brady-1/+4
* tests/cut/cut.pl: Add a test case.
2026-04-05cut: adjust error message to be less specificPádraig Brady-1/+1
* src/cut.c (main): Cater for both misplaced -w and -d.
2026-04-05cut: implement -w,--whitespace-delimitedPádraig Brady-0/+12
* src/cut.c (cut_fields_ws): A new function handling both uni-byte and multi-byte cases. * tests/cut/cut.pl: Add a test cases.
2026-04-05cut: support single byte -d with GB18030 inputPádraig Brady-0/+33
* src/cut.c * tests/cut/mb-non-utf8.sh * tests/local.mk
2026-04-05cut: support multi-byte field delimitersPádraig Brady-0/+9
* src/cut.c * tests/cut/cut.pl
2026-04-05cut: support multi-byte input with -cPádraig Brady-0/+11
* src/cut.c * tests/cut/cut.pl
2026-03-23tests: cut: add test for -z with NUL delimiter and -s flagSylvestre Ledru-0/+1
* tests/cut/cut.pl (zerot-7): New test. Identified https://github.com/uutils/coreutils/pull/11394 https://github.com/coreutils/coreutils/pull/226
2026-03-04tests: cut: add test case for newline delimiter with -s flagSylvestre Ledru-0/+3
* tests/cut/cut.pl: Add a new test case. https://github.com/coreutils/coreutils/pull/211
2026-01-01maint: run 'make update-copyright'Collin Funk-3/+3
2025-12-22tests: avoid false failure due to ulimit on aarch64Pádraig Brady-0/+1
* tests/cut/cut-huge-range.sh: Add an extra 1MiB headroom, which was seen with aarch64. Reported at https://bugzilla.redhat.com/2424302
2025-12-22maint: tests/cut/cut-huge-range.sh: remove stale commentPádraig Brady-2/+0
* tests/cut/cut-huge-range.sh: expr supports bignums, so remove stale comment relating to previous non expr adjustment.
2025-12-01tests: cut: add a test for bounded memory operationCollin Funk-0/+40
* tests/cut/bounded-memory.sh: New file. * tests/local.mk (all_tests): Add the test.
2025-01-01maint: update all copyright year number rangesPádraig Brady-2/+2
Update to latest gnulib with new copyright year. Run "make update-copyright" and then... * gnulib: Update included in this commit as copyright years are the only change from the previous gnulib commit. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2024-01-17tests: make ulimit -v interact better with ASANPádraig Brady-1/+1
ulimit -v is generally not supported with ASAN, giving errors like: "ReserveShadowMemoryRange failed while trying to map 0x... bytes. Perhaps you're using ulimit -v" * tests/cp/link-heap.sh: Mention ASAN as a possible reason for skipping. * tests/csplit/csplit-heap.sh: Likewise. * tests/cut/cut-huge-range.sh: Likewise. * tests/dd/no-allocate.sh: Likewise. * tests/printf/printf-surprise.sh: Likewise. * tests/rm/many-dir-entries-vs-OOM.sh: Likewise. * tests/head/head-c.sh: Only skip the part of the test needing ulimit. * tests/split/line-bytes.sh: Likewise.
2024-01-01maint: update all copyright year number rangesPádraig Brady-2/+2
Update to latest gnulib with new copyright year. Run "make update-copyright" and then... * gnulib: Update included in this commit as copyright years are the only change from the previous gnulib commit. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Manually update copyright year, until we fully sync with gnulib at a later stage. * tests/sample-test: Adjust to use the single most recent year.
2023-11-16tests: omit inapplicable test codePaul Eggert-1/+1
* tests/misc/join.pl, tests/uniq/uniq.pl: Remove test for "invalid byte, character or field list" message that is not generated.
2023-06-19tests: move tests to a directory per utilitySylvestre Ledru-0/+302
* cfg.mk: Adjust syntax check exclusion paths. * tests/local.mk: Adjust for renamed tests.
2008-05-06tests: remove directory, tests/cut/Jim Meyering-137/+0
* configure.ac (AC_CONFIG_FILES): Remove tests/cut/Makefile. * tests/Makefile.am (SUBDIRS): Remove cut. * tests/misc/cut: Many new tests, from... * tests/cut/Test.pm: ...here. Remove file.
2007-12-01Change comments: say bug present up to coreutils-6.9, not fixed in 6.10.Jim Meyering-1/+1
* tests/cut/Test.pm: Adjust comment. * tests/misc/cut: Likewise. * tests/misc/ls-misc: Likewise. * tests/misc/od: Likewise. * tests/misc/stty-invalid: Likewise. * tests/tr/Test.pm: Likewise.
2007-08-25Remove all .cvsignore files from version control.Jim Meyering-7/+0
2007-07-23Update all copyright notices to use the newer form.Jim Meyering-5/+3
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering-1/+1
2007-05-22"cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-"Jim Meyering-1/+8
Also, diagnose the '-' in "cut -f -" as an invalid range, rather than interpreting it as the unlimited range, "1-". * NEWS: Mention these changes. * src/cut.c (set_fields): Don't interpret an accumulator "value" of 0 as an unspecified range endpoint. Give better diagnostics. Adjust a comment so that it is true also for 64-bit size_t. * tests/cut/Test.pm: Add tests for the above.
2007-05-13Remove the generated tests/*/Makefile.am files from version control.Jim Meyering-82/+0
* tests/cut/Makefile.am: git-remove this generated file. * tests/head/Makefile.am: Likewise. * tests/join/Makefile.am: Likewise. * tests/pr/Makefile.am: Likewise. * tests/sort/Makefile.am: Likewise. * tests/tac/Makefile.am: Likewise. * tests/tail/Makefile.am: Likewise. * tests/test/Makefile.am: Likewise. * tests/tr/Makefile.am: Likewise. * tests/uniq/Makefile.am: Likewise. * tests/wc/Makefile.am: Likewise. * .cvsignore, .gitignore: Ignore these generated files. * src/.cvsignore, src/.gitignore: Add chcon here, ... * .cvsignore, .gitignore: ... not here.
2007-01-13Put CU_TEST_NAME in the environment for each test run by "make check".Jim Meyering-0/+1
* Transform all Makefile.am files so that when running "make check", CU_TEST_NAME is set to the name of the test. This is so that when I run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check" on the entire package it is more convenient to map a leak or error found in a valgrind log file back to the offending test. Use this command: (echo tests/Makefile.am.in; find tests -name Makefile.am) \ |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \ -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
2006-08-22* aclocal.m4, config.hin, configure:Paul Eggert-5/+4
Remove from CVS, since ./bootstrap generates them automatically. * .cvsignore: Add INSTALL, Makefile.in, *.cache, *.lineno, *.log. Remove more-specific entries. This catches files like configure.lineno. * man/.cvsignore: Add Makefile.in. * src/.cvsignore: Add Makefile.in. Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c. For .cvsignore file under the tests directory: Add Makefile.in. Sort entries if necessary. Remove *.I, *.E, *.X, *.O, *-tests, build-script, mk-script if they're never created in this directory. * build-aux/.cvsignore: New file. * doc/.cvsignore: Add Makefile.in, coreutils.html, coreutils.pdf, coreutils.ps, coreutils.tps. Remove coreutils.cm (dunno what it is, but the makefile doesn't mention it). Remove coreutils.info as it is subsumed by coreutils.info*. * lib/.cvsignore: Add Makefile.in, getdate.tab.h. Remove stat.c, sysexit.h. * m4/.cvsignore: Remove Makefile, dev-ino.m4, glibc2.m4, intdiv0.m4, inttypes-h.m4, inttypes-pri.m4, jm-glibc-io.m4, lcmessage.m4, lock.m4, printf-posix.m4, same-inode.m4, size_max.m4, uintmax_t.m4, ulonglong.m4, visibility.m4, xsize.m4. Many of these are put in automatically by ../bootstrap, but that's a bootstrap bug that I plan to fix shortly. * po/.cvsignore: More ../bootstrap-related fixes, plus remove old cruft. Add *.po, LINGUAS, Makevars. Remove *.cat, *.msg, cat-id-dbl.c, messages.mo, stamp-cat-id.
2006-08-21Remove from CVS, since the bootstrap script generates them automatically.Paul Eggert-645/+0
2006-08-19.Jim Meyering-1/+22
2006-08-19Some of my 2006-07-03 changes to tests/*/Makefile.am were beingJim Meyering-2/+4
backed out due to updates provoked by the copyright changes. * tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that it propagates to the derived Makefile.am files. ($(srcdir)/Makefile.am): Mark generated .am files as read-only, so we don't mistakenly edit them again. * tests/cut/Makefile.am: Regenerate. * tests/head/Makefile.am: Likewise. * tests/join/Makefile.am: Likewise. * tests/pr/Makefile.am: Likewise. * tests/sort/Makefile.am: Likewise. * tests/tac/Makefile.am: Likewise. * tests/tail/Makefile.am: Likewise. * tests/test/Makefile.am: Likewise. * tests/tr/Makefile.am: Likewise. * tests/uniq/Makefile.am: Likewise. * tests/wc/Makefile.am: Likewise.
2006-08-17Add/fix copyright notices and adjust to latest GNU FDL.Paul Eggert-1/+38
2006-08-15.Jim Meyering-39/+46
2006-08-09Regenerate.Paul Eggert-13/+15
2006-08-09Regenerate.Paul Eggert-34/+36