File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -742,9 +742,22 @@ mod tests {
742
742
assert_eq ! ( read_status( & mut mem( s) ) , result) ;
743
743
}
744
744
745
+ fn read_ignore_string ( s : & str , result : HttpResult < RawStatus > ) {
746
+ match ( read_status ( & mut mem ( s) ) , result) {
747
+ ( Ok ( RawStatus ( ref c1, _) ) , Ok ( RawStatus ( ref c2, _) ) ) => {
748
+ assert_eq ! ( c1, c2) ;
749
+ } ,
750
+ ( r1, r2) => assert_eq ! ( r1, r2)
751
+ }
752
+ }
753
+
745
754
read ( "200 OK\r \n " , Ok ( RawStatus ( 200 , Borrowed ( "OK" ) ) ) ) ;
746
755
read ( "404 Not Found\r \n " , Ok ( RawStatus ( 404 , Borrowed ( "Not Found" ) ) ) ) ;
747
756
read ( "200 crazy pants\r \n " , Ok ( RawStatus ( 200 , Owned ( "crazy pants" . to_string ( ) ) ) ) ) ;
757
+ read ( "301 Moved Permanently\r \n " , Ok ( RawStatus ( 301 , Owned ( "Moved Permanently" . to_string ( ) ) ) ) ) ;
758
+ read_ignore_string ( "301 Unreasonably long header that should not happen, \
759
+ but some men just want to watch the world burn\r \n ",
760
+ Ok ( RawStatus ( 301 , Owned ( "Ignored" . to_string ( ) ) ) ) ) ;
748
761
}
749
762
750
763
#[ test]
You can’t perform that action at this time.
0 commit comments