@@ -5,7 +5,10 @@ mod helpers;
5
5
fn test_fds_async ( ) {
6
6
use futures:: stream:: StreamExt as _;
7
7
8
- check_open_fds ( & [ 0 , 1 , 2 ] ) ;
8
+ let mut expected = String :: new ( ) ;
9
+ for fd in get_open_fds ( ) {
10
+ expected. push_str ( & format ! ( "{}" , fd) ) ;
11
+ }
9
12
10
13
let rt = tokio:: runtime:: Builder :: new_multi_thread ( )
11
14
. enable_all ( )
@@ -31,7 +34,7 @@ fn test_fds_async() {
31
34
32
35
let ( pty_r, _) = pty. split ( ) ;
33
36
let mut output = helpers:: output_async ( pty_r) ;
34
- assert_eq ! ( output. next( ) . await . unwrap( ) , "012 \r \n ") ;
37
+ assert_eq ! ( output. next( ) . await . unwrap( ) , format! ( "{expected} \r \n ") ) ;
35
38
36
39
let status = child. wait ( ) . await . unwrap ( ) ;
37
40
assert_eq ! ( status. code( ) . unwrap( ) , 0 ) ;
@@ -56,7 +59,7 @@ fn test_fds_async() {
56
59
57
60
let ( pty_r, _) = pty. split ( ) ;
58
61
let mut output = helpers:: output_async ( pty_r) ;
59
- assert_eq ! ( output. next( ) . await . unwrap( ) , "012 \r \n ") ;
62
+ assert_eq ! ( output. next( ) . await . unwrap( ) , format! ( "{expected} \r \n ") ) ;
60
63
61
64
let status = child. wait ( ) . await . unwrap ( ) ;
62
65
assert_eq ! ( status. code( ) . unwrap( ) , 0 ) ;
@@ -81,7 +84,7 @@ fn test_fds_async() {
81
84
82
85
let ( pty_r, _) = pty. split ( ) ;
83
86
let mut output = helpers:: output_async ( pty_r) ;
84
- assert_eq ! ( output. next( ) . await . unwrap( ) , "012 \r \n ") ;
87
+ assert_eq ! ( output. next( ) . await . unwrap( ) , format! ( "{expected} \r \n ") ) ;
85
88
86
89
let status = child. wait ( ) . await . unwrap ( ) ;
87
90
assert_eq ! ( status. code( ) . unwrap( ) , 0 ) ;
0 commit comments