mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-22 00:00:11 +02:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user