Commit Graph
46 Commits
Author SHA1 Message Date
Sylvestre LedruandDaniel Hofstetter 4fa689af89 tests/cut: ignore stdin write error on fast-exit delimiter test
test_single_quote_pair_as_delimiter_is_invalid is intermittent on
i686: the parent writes "a''b\n" to cut's stdin while cut validates
args and exits immediately with "delimiter must be a single
character". On a fast child exit, the kernel closes the pipe
read-end before the parent's write() runs, so write() returns
EPIPE and the pipe_in thread panics.

The race is inherent: draining stdin in cut before exiting on an
arg error would hang on terminals and read unbounded data from
long pipes, contradicting GNU behavior. Use the test framework's
ignore_stdin_write_error() flag, which exists for exactly this
"parent writes to child that exits fast" pattern.
2026-04-13 09:04:28 +02:00
AnthonyandGitHub 36ac85b1f3 tests: add WASI integration test support via wasmtime 2026-04-12 15:19:04 +02:00
Can BölükandGitHub 483f13e918 cut: improve function signature
and add test for existing functionality
2026-03-20 10:30:19 +01:00
can1357andDaniel Hofstetter 593f5b191e cut: reject literal '' delimiter special-casing 2026-03-19 17:15:15 +01:00
Daniel HofstetterandGitHub 8cfb32714c cut: improve some error messages (#11338) 2026-03-15 23:34:07 +01:00
akervaldandDaniel Hofstetter 9bbb58b746 cut: fix -s flag for newline delimiter and improve performance
- Fixed the -s flag incorrectly suppressing output when the delimiter is a newline.
- Improved performance in cut_fields_newline_char_delim.
- Updated tests to match GNU cut behavior for newline delimiters.
2026-03-04 11:05:25 +01:00
5d9afe8bc7 add tests with emoji for various commands (#8545)
* add tests with emoji for various commands

* test/ls: use touch instead of an empty write

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-09-03 09:57:04 +02:00
Sylvestre Ledru 1c5b95d1bb non-utf8: address review commits 2025-08-14 10:54:17 +02:00
Sylvestre Ledru 6e55a2a3bb Fix cut to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Dorian Peron 6e23d4e979 tests: patch tests to simplify imports 2025-07-01 03:36:46 +02:00
Jan Verbeek cba48c0284 cut: Flush BufWriter, centralize output file logic 2025-03-31 13:45:10 +02:00
Sylvestre Ledru a0179ea239 uutests: adjust the tests to use them 2025-03-28 21:40:31 +01:00
Sylvestre Ledru 18cb7dcf9e Use the new function fails_with_code
Done with
```
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs
$ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs
...
```
2025-03-01 17:26:20 +01:00
Daniel Hofstetter 20dfb27057 cut: fix handling of newline as delimiter 2024-12-27 09:12:47 +01:00
Daniel Hofstetter 392c48002c cut: don't merge adjacent ranges 2024-12-22 15:07:04 +01:00
Daniel Hofstetter cf8a81c6c2 cut: fix overriding of -d= 2024-12-20 10:02:36 +01:00
Daniel Hofstetter 6224c374ae cut: use short and long args in two tests 2024-12-18 16:17:30 +01:00
Daniel Hofstetter 5ea4903632 cut: rename some tests 2024-12-18 14:52:04 +01:00
Daniel Hofstetter 9aca24365f cut: simplify test by removing assert_eq! calls 2024-12-18 14:44:12 +01:00
Daniel Hofstetter 2f82853bfa cut: move two tests to better places within file 2024-12-18 14:42:18 +01:00
6755956bc4 cut.pl: adjust to our messages as they are better (#6921)
* cut.pl: adjust to our messages as they are better

but we still have some differences on this test

* cut: add some missing line return when needed

* cut: add failing tests covered by cut.pl

* Remove dup test

* cut: add spell-checker:ignore line to test

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-12-16 15:37:29 +01:00
5b087e9624 Fix cut when lines dont end with specified delim (#5844)
Print lines without delimiters only when they end with specified line terminator('\n' by default or `\0` if `-s`)

Signed-off-by: Andrei Stan <andreistan2003@gmail.com>
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2024-12-04 00:04:55 +01:00
Jadi 1137d9a62d cut: two new tests; -d conflict & no arg 2024-04-04 21:33:22 +03:30
Yury ZhytkouandGitHub 156d3f7ee7 cut: allow non utf8 characters for delimiters (#6037) 2024-03-10 22:36:17 +01:00
wolimst cb0ce0e1cb cut: show error for multiple mode args (-b, -c, -f) 2024-02-09 15:56:15 +09:00