Skip to content

Commit f638944

Browse files
committed
add test for "--"
1 parent 64181e9 commit f638944

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

rewatch/src/main.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,17 @@ mod tests {
256256
}
257257
}
258258

259+
#[test]
260+
fn double_dash_keeps_following_args_positional() {
261+
let cli = parse(&["rescript", "--", "-v"]).expect("expected build command");
262+
263+
assert_eq!(cli.verbose.log_level_filter(), LevelFilter::Info);
264+
match cli.command {
265+
cli::Command::Build(build_args) => assert_eq!(build_args.folder.folder, "-v"),
266+
other => panic!("expected build command, got {other:?}"),
267+
}
268+
}
269+
259270
#[test]
260271
fn unknown_subcommand_help_uses_global_help() {
261272
let err = parse(&["rescript", "xxx", "--help"]).expect_err("expected global help");

0 commit comments

Comments
 (0)