clap/clap_derive/tests/raw_idents.rs
2020-01-18 17:40:07 +05:30

17 lines
337 B
Rust

use clap::Clap;
#[test]
fn raw_idents() {
#[derive(Clap, Debug, PartialEq)]
struct Opt {
#[clap(short, long)]
r#type: Vec<String>,
}
assert_eq!(
Opt {
r#type: vec!["long".into(), "short".into()]
},
Opt::parse_from(&["test", "--type", "long", "-t", "short"])
);
}