mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
Add tests
This commit is contained in:
parent
4ce2a02f78
commit
bec16ae9e0
1 changed files with 27 additions and 0 deletions
|
@ -483,3 +483,30 @@ fn issue_1073_suboptimal_flag_suggestion() {
|
||||||
true
|
true
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn short_non_ascii_no_space() {
|
||||||
|
let matches = App::new("app")
|
||||||
|
.arg("<opt> -磨 <opt>")
|
||||||
|
.get_matches_from(&["test", "-磨VALUE"]);
|
||||||
|
|
||||||
|
assert_eq!("VALUE", matches.value_of("opt").unwrap());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn short_eq_val_starts_with_eq() {
|
||||||
|
let matches = App::new("app")
|
||||||
|
.arg("<opt> -f <opt>")
|
||||||
|
.get_matches_from(&["test", "-f==value"]);
|
||||||
|
|
||||||
|
assert_eq!("=value", matches.value_of("opt").unwrap());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn long_eq_val_starts_with_eq() {
|
||||||
|
let matches = App::new("app")
|
||||||
|
.arg("<opt> --foo <opt>")
|
||||||
|
.get_matches_from(&["test", "--foo==value"]);
|
||||||
|
|
||||||
|
assert_eq!("=value", matches.value_of("opt").unwrap());
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue