mirror of
https://github.com/clap-rs/clap
synced 2024-11-12 23:57:10 +00:00
tests(DisableHelpSubcommand): adds tests for AppSettings::DisableHelpSubcommand
This commit is contained in:
parent
a10fc859ee
commit
01caf84b87
1 changed files with 11 additions and 0 deletions
|
@ -371,3 +371,14 @@ fn test_unset_settings() {
|
|||
assert!(!m.p.is_set(AppSettings::AllowInvalidUtf8));
|
||||
assert!(!m.p.is_set(AppSettings::ColorAuto));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn disable_help_subcommand() {
|
||||
let result = App::new("disablehelp")
|
||||
.setting(AppSettings::DisableHelpSubcommand)
|
||||
.subcommand(SubCommand::with_name("sub1"))
|
||||
.get_matches_from_safe(vec!["", "help"]);
|
||||
assert!(result.is_err());
|
||||
let err = result.err().unwrap();
|
||||
assert_eq!(err.kind, ErrorKind::UnknownArgument);
|
||||
}
|
Loading…
Reference in a new issue