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

Function p2_cli_stdin

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

Source from the content-addressed store, hash-verified

1183
1184 #[test]
1185 fn p2_cli_stdin() -> Result<()> {
1186 let mut child = get_wasmtime_command()?
1187 .args(&["run", "-Wcomponent-model", P2_CLI_STDIN_COMPONENT])
1188 .stdout(Stdio::piped())
1189 .stderr(Stdio::piped())
1190 .stdin(Stdio::piped())
1191 .spawn()?;
1192 child
1193 .stdin
1194 .take()
1195 .unwrap()
1196 .write_all(b"So rested he by the Tumtum tree")
1197 .unwrap();
1198 let output = child.wait_with_output()?;
1199 println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
1200 println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
1201 assert!(output.status.success());
1202 Ok(())
1203 }
1204
1205 #[test]
1206 fn p2_cli_splice_stdin() -> Result<()> {

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected