mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
nl: don't exit if input is directory
This commit is contained in:
parent
8e83b347c6
commit
1c6bf6991c
2 changed files with 28 additions and 5 deletions
|
@ -634,3 +634,20 @@ fn test_empty_section_delimiter() {
|
|||
.stdout_is(" 1\ta\n \n 2\tb\n");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_directory_as_input() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let dir = "dir";
|
||||
let file = "file";
|
||||
let content = "aaa";
|
||||
|
||||
at.mkdir(dir);
|
||||
at.write(file, content);
|
||||
|
||||
ucmd.arg(dir)
|
||||
.arg(file)
|
||||
.fails()
|
||||
.stderr_is(format!("nl: {dir}: Is a directory\n"))
|
||||
.stdout_contains(content);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue