| 1162 | |
| 1163 | #[test] |
| 1164 | fn p2_cli_stdin_empty() -> Result<()> { |
| 1165 | let mut child = get_wasmtime_command()? |
| 1166 | .args(&["run", "-Wcomponent-model", P2_CLI_STDIN_EMPTY_COMPONENT]) |
| 1167 | .stdout(Stdio::piped()) |
| 1168 | .stderr(Stdio::piped()) |
| 1169 | .stdin(Stdio::piped()) |
| 1170 | .spawn()?; |
| 1171 | child |
| 1172 | .stdin |
| 1173 | .take() |
| 1174 | .unwrap() |
| 1175 | .write_all(b"not to be read") |
| 1176 | .unwrap(); |
| 1177 | let output = child.wait_with_output()?; |
| 1178 | println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); |
| 1179 | println!("stderr: {}", String::from_utf8_lossy(&output.stderr)); |
| 1180 | assert!(output.status.success()); |
| 1181 | Ok(()) |
| 1182 | } |
| 1183 | |
| 1184 | #[test] |
| 1185 | fn p2_cli_stdin() -> Result<()> { |