mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Merge pull request #2898 from jfinkels/tail-lines-zero-terminated
tail: support zero-terminated lines in streams
This commit is contained in:
commit
b8b642101f
3 changed files with 66 additions and 21 deletions
|
@ -548,3 +548,17 @@ fn test_no_such_file() {
|
|||
fn test_no_trailing_newline() {
|
||||
new_ucmd!().pipe_in("x").succeeds().stdout_only("x");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_lines_zero_terminated() {
|
||||
new_ucmd!()
|
||||
.args(&["-z", "-n", "2"])
|
||||
.pipe_in("a\0b\0c\0d\0e\0")
|
||||
.succeeds()
|
||||
.stdout_only("d\0e\0");
|
||||
new_ucmd!()
|
||||
.args(&["-z", "-n", "+2"])
|
||||
.pipe_in("a\0b\0c\0d\0e\0")
|
||||
.succeeds()
|
||||
.stdout_only("b\0c\0d\0e\0");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue