aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fds_async.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-12-03 02:00:32 -0500
committerJesse Luehrs <doy@tozt.net>2023-12-03 17:25:09 -0500
commit1895e6ca5338756bb3c8879ab3f6427ee476670a (patch)
tree5e4aa37273bb3da4a516b7dde2218cc9d6466159 /tests/fds_async.rs
parent1007cac2ac9c20496a5ec5a9a34b8ff84f874983 (diff)
downloadpty-process-1895e6ca5338756bb3c8879ab3f6427ee476670a.tar.gz
pty-process-1895e6ca5338756bb3c8879ab3f6427ee476670a.zip
wiptest
Diffstat (limited to 'tests/fds_async.rs')
-rw-r--r--tests/fds_async.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/fds_async.rs b/tests/fds_async.rs
index 6f3bcde..c9bff62 100644
--- a/tests/fds_async.rs
+++ b/tests/fds_async.rs
@@ -5,7 +5,10 @@ mod helpers;
fn test_fds_async() {
use futures::stream::StreamExt as _;
- check_open_fds(&[0, 1, 2]);
+ let mut expected = String::new();
+ for fd in get_open_fds() {
+ expected.push_str(&format!("{}", fd));
+ }
let rt = tokio::runtime::Builder::new_multi_thread()
.enable_all()
@@ -31,7 +34,7 @@ fn test_fds_async() {
let (pty_r, _) = pty.split();
let mut output = helpers::output_async(pty_r);
- assert_eq!(output.next().await.unwrap(), "012\r\n");
+ assert_eq!(output.next().await.unwrap(), format!("{expected}\r\n"));
let status = child.wait().await.unwrap();
assert_eq!(status.code().unwrap(), 0);
@@ -56,7 +59,7 @@ fn test_fds_async() {
let (pty_r, _) = pty.split();
let mut output = helpers::output_async(pty_r);
- assert_eq!(output.next().await.unwrap(), "012\r\n");
+ assert_eq!(output.next().await.unwrap(), format!("{expected}\r\n"));
let status = child.wait().await.unwrap();
assert_eq!(status.code().unwrap(), 0);
@@ -81,7 +84,7 @@ fn test_fds_async() {
let (pty_r, _) = pty.split();
let mut output = helpers::output_async(pty_r);
- assert_eq!(output.next().await.unwrap(), "012\r\n");
+ assert_eq!(output.next().await.unwrap(), format!("{expected}\r\n"));
let status = child.wait().await.unwrap();
assert_eq!(status.code().unwrap(), 0);