2015-08-27 21:03:45 +00:00
|
|
|
extern crate clap;
|
|
|
|
|
|
|
|
use clap::{App, Arg};
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
|
|
|
fn unique_arg_names() {
|
2016-01-21 06:48:30 +00:00
|
|
|
App::new("some").args(&[
|
2015-08-27 21:03:45 +00:00
|
|
|
Arg::with_name("arg").short("a"),
|
|
|
|
Arg::with_name("arg").short("b")
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
|
|
|
fn unique_arg_shorts() {
|
2016-01-21 06:48:30 +00:00
|
|
|
App::new("some").args(&[
|
2015-08-27 21:03:45 +00:00
|
|
|
Arg::with_name("arg1").short("a"),
|
|
|
|
Arg::with_name("arg2").short("a")
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
|
|
|
fn unique_arg_longs() {
|
2016-01-21 06:48:30 +00:00
|
|
|
App::new("some").args(&[
|
2015-08-27 21:03:45 +00:00
|
|
|
Arg::with_name("arg1").long("long"),
|
|
|
|
Arg::with_name("arg2").long("long")
|
|
|
|
]);
|
2016-01-21 06:48:30 +00:00
|
|
|
}
|