()
| 670 | |
| 671 | #[test] |
| 672 | fn name_same_as_builtin_command() -> Result<()> { |
| 673 | // a bare subcommand shouldn't run successfully |
| 674 | let output = get_wasmtime_command()? |
| 675 | .current_dir("tests/all/cli_tests") |
| 676 | .arg("run") |
| 677 | .output()?; |
| 678 | assert!(!output.status.success()); |
| 679 | |
| 680 | // a `--` prefix should let everything else get interpreted as a wasm |
| 681 | // module and arguments, even if the module has a name like `run` |
| 682 | let output = get_wasmtime_command()? |
| 683 | .current_dir("tests/all/cli_tests") |
| 684 | .arg("--") |
| 685 | .arg("run") |
| 686 | .output()?; |
| 687 | assert!(output.status.success(), "expected success got {output:#?}"); |
| 688 | |
| 689 | // Passing options before the subcommand should work and doesn't require |
| 690 | // `--` to disambiguate |
| 691 | let output = get_wasmtime_command()? |
| 692 | .current_dir("tests/all/cli_tests") |
| 693 | .arg("-Ccache=n") |
| 694 | .arg("run") |
| 695 | .output()?; |
| 696 | assert!(output.status.success(), "expected success got {output:#?}"); |
| 697 | Ok(()) |
| 698 | } |
| 699 | |
| 700 | #[test] |
| 701 | #[cfg(unix)] |
nothing calls this directly
no test coverage detected