1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

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>
This commit is contained in:
andreistan26 2024-12-04 01:04:55 +02:00 committed by GitHub
parent 17d4e4fde1
commit 5b087e9624
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View file

@ -282,6 +282,15 @@ fn test_multiple() {
assert_eq!(result.stderr_str(), "");
}
#[test]
fn test_newline_delimited() {
new_ucmd!()
.args(&["-f", "1", "-d", "\n"])
.pipe_in("a:1\nb:")
.succeeds()
.stdout_only_bytes("a:1\n");
}
#[test]
fn test_multiple_mode_args() {
for args in [