Skip to content

Commit

Permalink
test(assert): Verify empty positional assert exists
Browse files Browse the repository at this point in the history
Wondered if we had this for #4467.  Figured we should actually test it.
  • Loading branch information
epage committed Nov 10, 2022
1 parent 0d27188 commit ec03972
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/builder/multiple_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit ec03972

Please sign in to comment.