| 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)] |