mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
refactor tests (#1982)
This commit is contained in:
parent
0ea35f3fbc
commit
646c6cacbc
25 changed files with 373 additions and 521 deletions
|
@ -2,18 +2,15 @@ use crate::common::util::*;
|
|||
|
||||
#[test]
|
||||
fn test_more_no_arg() {
|
||||
let (_, mut ucmd) = at_and_ucmd!();
|
||||
let result = ucmd.run();
|
||||
assert!(!result.success);
|
||||
// stderr = more: Reading from stdin isn't supported yet.
|
||||
new_ucmd!().fails();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_more_dir_arg() {
|
||||
let (_, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.arg(".");
|
||||
let result = ucmd.run();
|
||||
assert!(!result.success);
|
||||
let result = new_ucmd!().arg(".").run();
|
||||
result.failure();
|
||||
const EXPECTED_ERROR_MESSAGE: &str =
|
||||
"more: '.' is a directory.\nTry 'more --help' for more information.";
|
||||
assert_eq!(result.stderr.trim(), EXPECTED_ERROR_MESSAGE);
|
||||
assert_eq!(result.stderr_str().trim(), EXPECTED_ERROR_MESSAGE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue