Skip to content

Commit

Permalink
Merge pull request #4471 from epage/assert
Browse files Browse the repository at this point in the history
test(assert): Verify empty positional assert exists
  • Loading branch information
epage committed Nov 10, 2022
2 parents 0d27188 + ec03972 commit 4d69e56
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/builder/multiple_values.rs
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 4d69e56

Please sign in to comment.