Skip to content

Commit ec03972

Browse files
committed
test(assert): Verify empty positional assert exists
Wondered if we had this for #4467. Figured we should actually test it.
1 parent 0d27188 commit ec03972

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/builder/multiple_values.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,3 +1570,10 @@ fn issue_2229() {
15701570
assert!(m.is_err());
15711571
assert_eq!(m.unwrap_err().kind(), ErrorKind::WrongNumberOfValues);
15721572
}
1573+
1574+
#[test]
1575+
#[should_panic = "Argument 'pos` is positional, it must take a value"]
1576+
fn disallow_positionals_without_values() {
1577+
let cmd = Command::new("test").arg(Arg::new("pos").num_args(0));
1578+
cmd.debug_assert();
1579+
}

0 commit comments

Comments
 (0)