test: add failing test for #2022

Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
This commit is contained in:
Yaroslav Bolyukin 2020-10-09 23:43:46 +05:00
parent 7df091775c
commit 659d688543
No known key found for this signature in database
GPG key ID: 40B5D6948143175F

View file

@ -510,3 +510,12 @@ fn long_eq_val_starts_with_eq() {
assert_eq!("=value", matches.value_of("opt").unwrap()); assert_eq!("=value", matches.value_of("opt").unwrap());
} }
#[test]
fn issue_2022_get_flags_misuse() {
let app = App::new("test")
.help_heading("test")
.arg(Arg::new("a").long("a").default_value("32"));
let matches = app.get_matches_from(&[""]);
assert!(matches.value_of("a").is_some())
}