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

test: refactor error handling with ParseError enum

This commit is contained in:
leon3s 2023-03-25 03:42:15 +01:00
parent 9fb18bb08c
commit bf94e8fff1
4 changed files with 105 additions and 48 deletions

View file

@ -928,3 +928,16 @@ fn test_long_integer() {
])
.fails();
}
#[test]
fn test_missing_argument_after() {
let mut ucmd = new_ucmd!();
let result = ucmd.args(&["(", "foo"]).fails();
result.no_stdout();
assert_eq!(result.exit_status().code().unwrap(), 2);
assert_eq!(
result.stderr_str().trim(),
"test: missing argument after 'foo'"
);
}