File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -593,4 +593,26 @@ mod tests {
593
593
assert_eq ! ( trailers[ "Expires" ] , "Wed, 21 Oct 2015 07:28:00 GMT" ) ;
594
594
} ) ;
595
595
}
596
+
597
+ #[ test]
598
+ fn test_ff7 ( ) {
599
+ async_std:: task:: block_on ( async move {
600
+ let mut input: Vec < u8 > = b"FF7\r \n " . to_vec ( ) ;
601
+ input. extend ( vec ! [ b'X' ; 0xFF7 ] ) ;
602
+ input. extend ( b"\r \n 4\r \n " ) ;
603
+ input. extend ( vec ! [ b'Y' ; 4 ] ) ;
604
+ input. extend ( b"\r \n 0\r \n \r \n " ) ;
605
+
606
+ let ( s, _r) = async_channel:: bounded ( 1 ) ;
607
+ let sender = Sender :: new ( s) ;
608
+ let mut decoder = ChunkedDecoder :: new ( async_std:: io:: Cursor :: new ( input) , sender) ;
609
+
610
+ let mut output = String :: new ( ) ;
611
+ decoder. read_to_string ( & mut output) . await . unwrap ( ) ;
612
+ assert_eq ! (
613
+ output,
614
+ "X" . to_string( ) . repeat( 0xFF7 ) + & "Y" . to_string( ) . repeat( 4 )
615
+ ) ;
616
+ } ) ;
617
+ }
596
618
}
You can’t perform that action at this time.
0 commit comments