@@ -95,7 +95,10 @@ impl Decoder {
9595 // methods
9696
9797 pub ( crate ) fn is_eof ( & self ) -> bool {
98- matches ! ( self . kind, Length ( 0 ) | Chunked ( ChunkedState :: End , _) | Eof ( true ) )
98+ matches ! (
99+ self . kind,
100+ Length ( 0 ) | Chunked ( ChunkedState :: End , _) | Eof ( true )
101+ )
99102 }
100103
101104 pub ( crate ) fn decode < R : MemRead > (
@@ -471,6 +474,7 @@ mod tests {
471474 use crate::mock::AsyncIo;
472475 */
473476
477+ #[ cfg( not( miri) ) ]
474478 #[ tokio:: test]
475479 async fn test_read_chunk_size ( ) {
476480 use std:: io:: ErrorKind :: { InvalidData , InvalidInput , UnexpectedEof } ;
@@ -553,6 +557,7 @@ mod tests {
553557 read_err ( "f0000000000000003\r \n " , InvalidData ) . await ;
554558 }
555559
560+ #[ cfg( not( miri) ) ]
556561 #[ tokio:: test]
557562 async fn test_read_sized_early_eof ( ) {
558563 let mut bytes = & b"foo bar" [ ..] ;
@@ -562,6 +567,7 @@ mod tests {
562567 assert_eq ! ( e. kind( ) , io:: ErrorKind :: UnexpectedEof ) ;
563568 }
564569
570+ #[ cfg( not( miri) ) ]
565571 #[ tokio:: test]
566572 async fn test_read_chunked_early_eof ( ) {
567573 let mut bytes = & b"\
@@ -574,6 +580,7 @@ mod tests {
574580 assert_eq ! ( e. kind( ) , io:: ErrorKind :: UnexpectedEof ) ;
575581 }
576582
583+ #[ cfg( not( miri) ) ]
577584 #[ tokio:: test]
578585 async fn test_read_chunked_single_read ( ) {
579586 let mut mock_buf = & b"10\r \n 1234567890abcdef\r \n 0\r \n " [ ..] ;
@@ -586,6 +593,7 @@ mod tests {
586593 assert_eq ! ( "1234567890abcdef" , & result) ;
587594 }
588595
596+ #[ cfg( not( miri) ) ]
589597 #[ tokio:: test]
590598 async fn test_read_chunked_trailer_with_missing_lf ( ) {
591599 let mut mock_buf = & b"10\r \n 1234567890abcdef\r \n 0\r \n bad\r \r \n " [ ..] ;
@@ -595,6 +603,7 @@ mod tests {
595603 assert_eq ! ( e. kind( ) , io:: ErrorKind :: InvalidInput ) ;
596604 }
597605
606+ #[ cfg( not( miri) ) ]
598607 #[ tokio:: test]
599608 async fn test_read_chunked_after_eof ( ) {
600609 let mut mock_buf = & b"10\r \n 1234567890abcdef\r \n 0\r \n \r \n " [ ..] ;
@@ -659,26 +668,29 @@ mod tests {
659668 }
660669 }
661670
671+ #[ cfg( not( miri) ) ]
662672 #[ tokio:: test]
663673 async fn test_read_length_async ( ) {
664674 let content = "foobar" ;
665675 all_async_cases ( content, content, Decoder :: length ( content. len ( ) as u64 ) ) . await ;
666676 }
667677
678+ #[ cfg( not( miri) ) ]
668679 #[ tokio:: test]
669680 async fn test_read_chunked_async ( ) {
670681 let content = "3\r \n foo\r \n 3\r \n bar\r \n 0\r \n \r \n " ;
671682 let expected = "foobar" ;
672683 all_async_cases ( content, expected, Decoder :: chunked ( ) ) . await ;
673684 }
674685
686+ #[ cfg( not( miri) ) ]
675687 #[ tokio:: test]
676688 async fn test_read_eof_async ( ) {
677689 let content = "foobar" ;
678690 all_async_cases ( content, content, Decoder :: eof ( ) ) . await ;
679691 }
680692
681- #[ cfg( feature = "nightly" ) ]
693+ #[ cfg( all ( feature = "nightly" , not ( miri ) ) ) ]
682694 #[ bench]
683695 fn bench_decode_chunked_1kb ( b : & mut test:: Bencher ) {
684696 let rt = new_runtime ( ) ;
@@ -702,7 +714,7 @@ mod tests {
702714 } ) ;
703715 }
704716
705- #[ cfg( feature = "nightly" ) ]
717+ #[ cfg( all ( feature = "nightly" , not ( miri ) ) ) ]
706718 #[ bench]
707719 fn bench_decode_length_1kb ( b : & mut test:: Bencher ) {
708720 let rt = new_runtime ( ) ;
0 commit comments