1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

more: add error message if the argument is a directory (#1983)

This commit is contained in:
Jamie Quigley 2021-04-02 21:34:02 +01:00 committed by GitHub
parent 9fbed0b07a
commit 31f5666727
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View file

@ -6,3 +6,14 @@ fn test_more_no_arg() {
let result = ucmd.run();
assert!(!result.success);
}
#[test]
fn test_more_dir_arg() {
let (_, mut ucmd) = at_and_ucmd!();
ucmd.arg(".");
let result = ucmd.run();
assert!(!result.success);
const EXPECTED_ERROR_MESSAGE: &str =
"more: '.' is a directory.\nTry 'more --help' for more information.";
assert_eq!(result.stderr.trim(), EXPECTED_ERROR_MESSAGE);
}