change anon_pipe_spawn_echo to use printf(1)

The illumos version of `echo(1)` doesn't support `-n`, so it interprets
it literally as part of the string to echo, making the test fail. I've
changed it to use `printf(1)` with no flags args to get the same
behavior.

I also changed the name of the test, since it doesn't actually spawn
`echo(1)` anymore :)
This commit is contained in:
Eliza Weisman
2024-08-12 11:34:06 -07:00
parent b8552c65d5
commit 38cc55b338
+2 -3
View File
@@ -457,15 +457,14 @@ async fn anon_pipe_simple_send() -> io::Result<()> {
}
#[tokio::test]
async fn anon_pipe_spawn_echo() -> std::io::Result<()> {
async fn anon_pipe_spawn_printf() -> std::io::Result<()> {
use tokio::process::Command;
const DATA: &str = "this is some data to write to the pipe";
let (tx, mut rx) = pipe::pipe()?;
let status = Command::new("echo")
.arg("-n")
let status = Command::new("printf")
.arg(DATA)
.stdout(tx.into_blocking_fd()?)
.status();