Fix Windows test error
Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
parent
a66715072f
commit
7756cb4552
13
src/lib.rs
13
src/lib.rs
|
@ -1323,6 +1323,11 @@ mod test {
|
||||||
cmd
|
cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
const OUTPUT: &[u8] = b"hello\n";
|
||||||
|
#[cfg(windows)]
|
||||||
|
const OUTPUT: &[u8] = b"hello\r\n";
|
||||||
|
|
||||||
future::block_on(async {
|
future::block_on(async {
|
||||||
// Thread should not be spawned off the bat.
|
// Thread should not be spawned off the bat.
|
||||||
assert!(!is_thread_spawned());
|
assert!(!is_thread_spawned());
|
||||||
|
@ -1338,7 +1343,7 @@ mod test {
|
||||||
}
|
}
|
||||||
.or(async {
|
.or(async {
|
||||||
let output = command().output().await.unwrap();
|
let output = command().output().await.unwrap();
|
||||||
assert_eq!(output.stdout, b"hello\n");
|
assert_eq!(output.stdout, OUTPUT);
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
assert!(!is_thread_spawned());
|
assert!(!is_thread_spawned());
|
||||||
|
@ -1357,7 +1362,7 @@ mod test {
|
||||||
})
|
})
|
||||||
.or(async {
|
.or(async {
|
||||||
let output = command().output().await.unwrap();
|
let output = command().output().await.unwrap();
|
||||||
assert_eq!(output.stdout, b"hello\n");
|
assert_eq!(output.stdout, OUTPUT);
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
assert!(!is_thread_spawned());
|
assert!(!is_thread_spawned());
|
||||||
|
@ -1372,7 +1377,7 @@ mod test {
|
||||||
}
|
}
|
||||||
.or(async {
|
.or(async {
|
||||||
let output = command().output().await.unwrap();
|
let output = command().output().await.unwrap();
|
||||||
assert_eq!(output.stdout, b"hello\n");
|
assert_eq!(output.stdout, OUTPUT);
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
assert!(!is_thread_spawned());
|
assert!(!is_thread_spawned());
|
||||||
|
@ -1385,7 +1390,7 @@ mod test {
|
||||||
// We should now be able to poll the process future independently, it will spawn the
|
// We should now be able to poll the process future independently, it will spawn the
|
||||||
// thread.
|
// thread.
|
||||||
let output = command().output().await.unwrap();
|
let output = command().output().await.unwrap();
|
||||||
assert_eq!(output.stdout, b"hello\n");
|
assert_eq!(output.stdout, OUTPUT);
|
||||||
assert!(is_thread_spawned());
|
assert!(is_thread_spawned());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue