mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #1026 from evestera/cat-numlines-notrailing
cat: fix for numbered lines w/ no trailing newline
This commit is contained in:
commit
daba29b832
3 changed files with 42 additions and 33 deletions
1
tests/fixtures/cat/nonewline.txt
vendored
Normal file
1
tests/fixtures/cat/nonewline.txt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
text without a trailing newline
|
|
@ -22,6 +22,15 @@ fn test_output_multi_files_print_all_chars() {
|
|||
pM-qM-rM-sM-tM-uM-vM-wM-xM-yM-zM-{M-|M-}M-~M-^?");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_numbered_lines_no_trailing_newline() {
|
||||
new_ucmd!()
|
||||
.args(&["nonewline.txt", "alpha.txt", "-n"])
|
||||
.succeeds()
|
||||
.stdout_only(" 1\ttext without a trailing newlineabcde\n 2\tfghij\n \
|
||||
3\tklmno\n 4\tpqrst\n 5\tuvwxyz\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_show_nonprinting() {
|
||||
for same_param in vec!["-v", "--show-nonprinting"] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue