MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / name_same_as_builtin_command

Function name_same_as_builtin_command

tests/all/cli_tests.rs:672–698  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

670
671#[test]
672fn 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)]

Callers

nothing calls this directly

Calls 4

get_wasmtime_commandFunction · 0.85
OkFunction · 0.85
outputMethod · 0.80
argMethod · 0.45

Tested by

no test coverage detected