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:
Ed Page 2022-11-09 22:10:32 -06:00
parent 0d27188d87
commit ec03972023

View file

@ -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();
}