File tree 2 files changed +8
-8
lines changed 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -929,8 +929,8 @@ mod tests {
929
929
930
930
let mut buf = [ 0 ; 10 ] ;
931
931
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 ) ;
934
934
} ) ;
935
935
assert ! ( wait > Duration :: from_millis( 5 ) ) ;
936
936
assert ! ( wait < Duration :: from_millis( 15 ) ) ;
@@ -952,8 +952,8 @@ mod tests {
952
952
assert_eq ! ( b"hello world" , & buf[ ..] ) ;
953
953
954
954
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 ) ;
957
957
} ) ;
958
958
assert ! ( wait > Duration :: from_millis( 5 ) ) ;
959
959
assert ! ( wait < Duration :: from_millis( 15 ) ) ;
Original file line number Diff line number Diff line change @@ -393,8 +393,8 @@ mod tests {
393
393
394
394
let mut buf = [ 0 ; 10 ] ;
395
395
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 ) ;
398
398
} ) ;
399
399
assert ! ( wait > Duration :: from_millis( 5 ) ) ;
400
400
assert ! ( wait < Duration :: from_millis( 15 ) ) ;
@@ -414,8 +414,8 @@ mod tests {
414
414
assert_eq ! ( b"hello world" , & buf[ ..] ) ;
415
415
416
416
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 ) ;
419
419
} ) ;
420
420
assert ! ( wait > Duration :: from_millis( 5 ) ) ;
421
421
assert ! ( wait < Duration :: from_millis( 15 ) ) ;
You can’t perform that action at this time.
0 commit comments