mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
csplit: don't add a newline if the file doesn't end with one (#7901)
* csplit: don't add a newline if the file doesn't end with one * refactor test * refactor
This commit is contained in:
parent
bcc02e9cea
commit
a752f73476
2 changed files with 63 additions and 21 deletions
|
@ -1476,3 +1476,12 @@ fn test_directory_input_file() {
|
|||
.fails_with_code(1)
|
||||
.stderr_only("csplit: cannot open 'test_directory' for reading: Permission denied\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_no_trailing_newline() {
|
||||
new_ucmd!()
|
||||
.args(&["-", "2"])
|
||||
.pipe_in("a\nb\nc\nd")
|
||||
.succeeds()
|
||||
.stdout_only("2\n5\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue