2021-10-16 21:05:42 +00:00
|
|
|
#![cfg(feature = "unicode")]
|
|
|
|
|
2021-10-09 11:33:42 +00:00
|
|
|
#[test]
|
2021-11-29 16:34:42 +00:00
|
|
|
fn possible_values_ignore_case() {
|
2022-02-12 03:48:29 +00:00
|
|
|
let m = clap::Command::new("pv")
|
2021-10-09 11:33:42 +00:00
|
|
|
.arg(
|
|
|
|
clap::Arg::new("option")
|
|
|
|
.short('o')
|
2022-05-04 20:38:06 +00:00
|
|
|
.long("option")
|
2022-07-26 00:17:01 +00:00
|
|
|
.action(clap::ArgAction::Set)
|
2022-05-24 01:16:02 +00:00
|
|
|
.value_parser(["ä"])
|
2021-11-29 16:34:42 +00:00
|
|
|
.ignore_case(true),
|
2021-10-09 11:33:42 +00:00
|
|
|
)
|
|
|
|
.try_get_matches_from(vec!["pv", "--option", "Ä"]);
|
|
|
|
|
2021-12-27 19:57:38 +00:00
|
|
|
assert!(m.is_ok(), "{}", m.unwrap_err());
|
2022-05-24 15:16:50 +00:00
|
|
|
assert!(m
|
|
|
|
.unwrap()
|
|
|
|
.get_one::<String>("option")
|
|
|
|
.map(|v| v.as_str())
|
|
|
|
.is_some());
|
2021-10-09 11:33:42 +00:00
|
|
|
}
|