clap/tests/unicode.rs
Ed Page 56a6a7418e fix: Allow unicode-aware case insensitivity with ArgValue
This also opens us up to being more unicode aware in other places, like
our sorting of arguments in the help.

Fixes #2792
2021-10-09 07:21:45 -05:00

17 lines
488 B
Rust

#[test]
#[cfg(feature = "unicode")]
fn possible_values_case_insensitive() {
let m = clap::App::new("pv")
.arg(
clap::Arg::new("option")
.short('o')
.long("--option")
.takes_value(true)
.possible_value("ä")
.case_insensitive(true),
)
.try_get_matches_from(vec!["pv", "--option", "Ä"]);
assert!(m.is_ok());
assert!(m.unwrap().value_of("option").is_some());
}