mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
18 lines
337 B
Rust
18 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"])
|
||
|
);
|
||
|
}
|