Skip to content

Commit ee80725

Browse files
committed
fix test check
1 parent 31a40b7 commit ee80725

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

tests/std_unix/into_inner_write_stdin.rs

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ use super::prelude::*;
22

33
#[test]
44
fn nowrap() -> Result<()> {
5-
let mut child = StdCommandWrap::with_new("cat", |command| {
6-
command.stdin(Stdio::piped()).stdout(Stdio::piped());
7-
})
8-
.spawn()?
9-
.into_inner();
5+
let mut child = unsafe {
6+
StdCommandWrap::with_new("cat", |command| {
7+
command.stdin(Stdio::piped()).stdout(Stdio::piped());
8+
})
9+
.spawn()?
10+
.into_inner_child()
11+
};
1012

1113
if let Some(mut din) = child.stdin.take() {
1214
din.write_all(b"hello")?;
@@ -23,12 +25,14 @@ fn nowrap() -> Result<()> {
2325

2426
#[test]
2527
fn process_group() -> Result<()> {
26-
let mut child = StdCommandWrap::with_new("cat", |command| {
27-
command.stdin(Stdio::piped()).stdout(Stdio::piped());
28-
})
29-
.wrap(ProcessGroup::leader())
30-
.spawn()?
31-
.into_inner();
28+
let mut child = unsafe {
29+
StdCommandWrap::with_new("cat", |command| {
30+
command.stdin(Stdio::piped()).stdout(Stdio::piped());
31+
})
32+
.wrap(ProcessGroup::leader())
33+
.spawn()?
34+
.into_inner_child()
35+
};
3236

3337
if let Some(mut din) = child.stdin.take() {
3438
din.write_all(b"hello")?;
@@ -45,12 +49,14 @@ fn process_group() -> Result<()> {
4549

4650
#[test]
4751
fn process_session() -> Result<()> {
48-
let mut child = StdCommandWrap::with_new("cat", |command| {
49-
command.stdin(Stdio::piped()).stdout(Stdio::piped());
50-
})
51-
.wrap(ProcessSession)
52-
.spawn()?
53-
.into_inner();
52+
let mut child = unsafe {
53+
StdCommandWrap::with_new("cat", |command| {
54+
command.stdin(Stdio::piped()).stdout(Stdio::piped());
55+
})
56+
.wrap(ProcessSession)
57+
.spawn()?
58+
.into_inner_child()
59+
};
5460

5561
if let Some(mut din) = child.stdin.take() {
5662
din.write_all(b"hello")?;

0 commit comments

Comments
 (0)