1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

Merge pull request #6853 from sylvestre/comm

comm: generate an error if the input is a directory
This commit is contained in:
Daniel Hofstetter 2024-11-30 10:55:14 +01:00 committed by GitHub
commit 6a7c0112cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 3 deletions

View file

@ -292,3 +292,36 @@ fn test_no_such_file() {
.fails()
.stderr_only("comm: bogus_file_1: No such file or directory\n");
}
#[test]
fn test_is_dir() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
scene
.ucmd()
.args(&[".", "."])
.fails()
.stderr_only("comm: .: Is a directory\n");
at.mkdir("dir");
scene
.ucmd()
.args(&["dir", "."])
.fails()
.stderr_only("comm: dir: Is a directory\n");
at.touch("file");
scene
.ucmd()
.args(&[".", "file"])
.fails()
.stderr_only("comm: .: Is a directory\n");
at.touch("file");
scene
.ucmd()
.args(&["file", "."])
.fails()
.stderr_only("comm: .: Is a directory\n");
}