1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 19:36:16 +00:00

dircolors: trigger an error when used on /

This commit is contained in:
Sylvestre Ledru 2023-03-28 22:46:59 +02:00
parent 2447849bdc
commit d29f9f2e30
2 changed files with 25 additions and 4 deletions

View file

@ -221,3 +221,13 @@ fn test_helper(file_name: &str, term: &str) {
.run()
.stdout_is_fixture(format!("{file_name}.sh.expected"));
}
#[test]
fn test_dircolors_for_dir_as_file() {
let result = new_ucmd!().args(&["-c", "/"]).fails();
result.no_stdout();
assert_eq!(
result.stderr_str().trim(),
"dircolors: expected file, got directory '/'",
);
}