mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 03:55:28 +00:00
Add unknown short flag test
This commit is contained in:
parent
afbda444ef
commit
1e11a99991
@ -239,6 +239,19 @@ mod tests {
|
||||
assert!(!flags.is_present("output_file"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_unknown_short_flag() {
|
||||
let flags_info = [
|
||||
ArgFlag::long("output_file").short('o'),
|
||||
Flag::long("verbose").short('v'),
|
||||
Flag::long("help").short('h'),
|
||||
];
|
||||
|
||||
let args = gen_args("ouch a.zip -s b.tar.gz");
|
||||
let result = filter_flags(args, &flags_info).unwrap_err();
|
||||
assert!(matches!(result, OofError::UnknownShortFlag('s')));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_pop_subcommand() {
|
||||
let subcommands = &["commit", "add", "push", "remote"];
|
||||
|
Loading…
x
Reference in New Issue
Block a user