File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -929,8 +929,8 @@ mod tests {
929929
930930 let mut buf = [ 0 ; 10 ] ;
931931 let wait = Duration :: span ( || {
932- assert_eq ! ( ErrorKind :: WouldBlock ,
933- stream . read ( & mut buf ) . err ( ) . expect ( "expected error" ) . kind ( ) ) ;
932+ let kind = stream . read ( & mut buf ) . err ( ) . expect ( "expected error" ) . kind ( ) ;
933+ assert ! ( kind == ErrorKind :: WouldBlock || kind == ErrorKind :: TimedOut ) ;
934934 } ) ;
935935 assert ! ( wait > Duration :: from_millis( 5 ) ) ;
936936 assert ! ( wait < Duration :: from_millis( 15 ) ) ;
@@ -952,8 +952,8 @@ mod tests {
952952 assert_eq ! ( b"hello world" , & buf[ ..] ) ;
953953
954954 let wait = Duration :: span ( || {
955- assert_eq ! ( ErrorKind :: WouldBlock ,
956- stream . read ( & mut buf ) . err ( ) . expect ( "expected error" ) . kind ( ) ) ;
955+ let kind = stream . read ( & mut buf ) . err ( ) . expect ( "expected error" ) . kind ( ) ;
956+ assert ! ( kind == ErrorKind :: WouldBlock || kind == ErrorKind :: TimedOut ) ;
957957 } ) ;
958958 assert ! ( wait > Duration :: from_millis( 5 ) ) ;
959959 assert ! ( wait < Duration :: from_millis( 15 ) ) ;
Original file line number Diff line number Diff line change @@ -393,8 +393,8 @@ mod tests {
393393
394394 let mut buf = [ 0 ; 10 ] ;
395395 let wait = Duration :: span ( || {
396- assert_eq ! ( ErrorKind :: WouldBlock ,
397- stream . recv_from ( & mut buf ) . err ( ) . expect ( "expected error" ) . kind ( ) ) ;
396+ let kind = stream . read ( & mut buf ) . err ( ) . expect ( "expected error" ) . kind ( ) ;
397+ assert ! ( kind == ErrorKind :: WouldBlock || kind == ErrorKind :: TimedOut ) ;
398398 } ) ;
399399 assert ! ( wait > Duration :: from_millis( 5 ) ) ;
400400 assert ! ( wait < Duration :: from_millis( 15 ) ) ;
@@ -414,8 +414,8 @@ mod tests {
414414 assert_eq ! ( b"hello world" , & buf[ ..] ) ;
415415
416416 let wait = Duration :: span ( || {
417- assert_eq ! ( ErrorKind :: WouldBlock ,
418- stream . recv_from ( & mut buf ) . err ( ) . expect ( "expected error" ) . kind ( ) ) ;
417+ let kind = stream . read ( & mut buf ) . err ( ) . expect ( "expected error" ) . kind ( ) ;
418+ assert ! ( kind == ErrorKind :: WouldBlock || kind == ErrorKind :: TimedOut ) ;
419419 } ) ;
420420 assert ! ( wait > Duration :: from_millis( 5 ) ) ;
421421 assert ! ( wait < Duration :: from_millis( 15 ) ) ;
You can’t perform that action at this time.
0 commit comments