clap/tests/builder/unicode.rs

19 lines
506 B
Rust
Raw Normal View History

2021-10-16 21:05:42 +00:00
#![cfg(feature = "unicode")]
#[test]
fn possible_values_ignore_case() {
2022-02-12 03:48:29 +00:00
let m = clap::Command::new("pv")
.arg(
clap::Arg::new("option")
.short('o')
.long("--option")
.takes_value(true)
.possible_value("ä")
.ignore_case(true),
)
.try_get_matches_from(vec!["pv", "--option", "Ä"]);
2021-12-27 19:57:38 +00:00
assert!(m.is_ok(), "{}", m.unwrap_err());
assert!(m.unwrap().value_of("option").is_some());
}