diff options
Diffstat (limited to 'clap/tests/unique_args.rs')
-rw-r--r-- | clap/tests/unique_args.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clap/tests/unique_args.rs b/clap/tests/unique_args.rs new file mode 100644 index 0000000..8710248 --- /dev/null +++ b/clap/tests/unique_args.rs @@ -0,0 +1,22 @@ +extern crate clap; + +use clap::{App, Arg}; + +#[test] +#[should_panic] +fn unique_arg_names() { + App::new("some").args(&[Arg::with_name("arg").short("a"), Arg::with_name("arg").short("b")]); +} + +#[test] +#[should_panic] +fn unique_arg_shorts() { + App::new("some").args(&[Arg::with_name("arg1").short("a"), Arg::with_name("arg2").short("a")]); +} + +#[test] +#[should_panic] +fn unique_arg_longs() { + App::new("some") + .args(&[Arg::with_name("arg1").long("long"), Arg::with_name("arg2").long("long")]); +} |