ls: Fix error message for ls file/missing-file

This commit is contained in:
oech3
2026-03-30 10:29:13 +02:00
committed by Daniel Hofstetter
parent ad132f3b66
commit 93157b7ebe
3 changed files with 16 additions and 0 deletions
+14
View File
@@ -57,6 +57,20 @@ const COMMA_ARGS: &[&str] = &["-m", "--format=commas", "--for=commas"];
const COLUMN_ARGS: &[&str] = &["-C", "--format=columns", "--for=columns"];
#[test]
#[cfg(unix)]
fn test_directory_in_file() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.touch("file");
scene
.ucmd()
.arg("file/missing")
.fails_with_code(2)
.stderr_is("ls: cannot access 'file/missing': Not a directory\n");
}
#[test]
fn test_invalid_flag() {
new_ucmd!()