Commit Graph
41 Commits
Author SHA1 Message Date
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
Daniel Hofstetter c8cd355708 cut: set exit code to 1 if dir is specified 2024-01-26 10:18:44 +01:00
Daniel Hofstetter 5bd00eb791 cut: split test function into two functions 2024-01-26 10:09:28 +01:00
Sylvestre Ledru bc51b8d216 cut: allow the same option to be passed multiple times 2024-01-13 15:09:16 +01:00
Daniel Hofstetter 6eec4fe8f9 cut: add test & improve error message 2023-11-29 09:41:11 +01:00
Sylvestre Ledru 99120d32c1 cut: fail when the input == usize::MAX 2023-09-26 09:40:21 +02:00