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

Function p3_cli_read_stdin

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

Source from the content-addressed store, hash-verified

2938
2939 #[test]
2940 fn p3_cli_read_stdin() -> Result<()> {
2941 let mut cmd = get_wasmtime_command()?;
2942 let mut child = cmd
2943 .arg("-Sp3")
2944 .arg("-Wcomponent-model-async")
2945 .arg(P3_CLI_READ_STDIN_COMPONENT)
2946 .stdin(std::process::Stdio::piped())
2947 .stdout(std::process::Stdio::piped())
2948 .stderr(std::process::Stdio::piped())
2949 .spawn()
2950 .unwrap();
2951 child.stdin.take().unwrap().write_all(b"hello!").unwrap();
2952 let output = child.wait_with_output()?;
2953 println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
2954 println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
2955 assert!(output.status.success());
2956
2957 Ok(())
2958 }
2959
2960 #[test]
2961 #[cfg_attr(not(feature = "component-model-async"), ignore)]

Callers

nothing calls this directly

Calls 10

get_wasmtime_commandFunction · 0.85
OkFunction · 0.85
write_allMethod · 0.80
unwrapMethod · 0.45
spawnMethod · 0.45
stderrMethod · 0.45
stdoutMethod · 0.45
stdinMethod · 0.45
argMethod · 0.45
takeMethod · 0.45

Tested by

no test coverage detected