mirror of
https://github.com/clap-rs/clap
synced 2024-12-15 07:12:32 +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"])
|
||
|
);
|
||
|
}
|