mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
test(assert): Verify empty positional assert exists
Wondered if we had this for #4467. Figured we should actually test it.
This commit is contained in:
parent
0d27188d87
commit
ec03972023
1 changed files with 7 additions and 0 deletions
|
@ -1570,3 +1570,10 @@ fn issue_2229() {
|
|||
assert!(m.is_err());
|
||||
assert_eq!(m.unwrap_err().kind(), ErrorKind::WrongNumberOfValues);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic = "Argument 'pos` is positional, it must take a value"]
|
||||
fn disallow_positionals_without_values() {
|
||||
let cmd = Command::new("test").arg(Arg::new("pos").num_args(0));
|
||||
cmd.debug_assert();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue