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

tsort: returns error when input is dir - same as GNU tsort (#5860)

* fix: return error when input is dir

* test: when tsort is given a dir

* fix: do not need to mention tsort in error message

* test: using concrete directory name

* tsort: fix formatting in test

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
SaHHiiLL 2024-01-19 14:39:00 +00:00 committed by GitHub
parent 63ef7e4fdf
commit 746a7b14d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View file

@ -64,3 +64,12 @@ fn test_multiple_arguments() {
.fails()
.stderr_contains("unexpected argument 'invalid_file' found");
}
#[test]
fn test_error_on_dir() {
let (at, mut ucmd) = at_and_ucmd!();
at.mkdir("tsort_test_dir");
ucmd.arg("tsort_test_dir")
.fails()
.stderr_contains("tsort: tsort_test_dir: read error: Is a directory");
}