File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,10 +156,16 @@ fn percent_encoded_international_path() -> crate::Result {
156156
157157#[ test]
158158fn percent_encoded_path_roundtrips_in_lossless_serialization ( ) -> crate :: Result {
159- let input = "https://%20@%40:example.org/%20%25" ;
160- let url = gix_url:: parse ( input. into ( ) ) ?;
161- let serialized = url. to_bstring ( ) ;
162- assert_eq ! ( serialized, input) ;
163- assert_eq ! ( gix_url:: parse( serialized. as_ref( ) ) ?, url) ;
159+ for ( input, expected_host, expected_path) in [
160+ ( "https://%20@%40:example.org/%20%25" , "%40:example.org" , "/ %" ) ,
161+ ( "https://%20@%40:example.org/%20%25/%20%25" , "%40:example.org" , "/ %/ %" ) ,
162+ ] {
163+ let url = gix_url:: parse ( input. into ( ) ) ?;
164+ let serialized = url. to_bstring ( ) ;
165+ assert_eq ! ( serialized, input) ;
166+ assert_eq ! ( url. host( ) , Some ( expected_host) ) ;
167+ assert_eq ! ( url. path, expected_path) ;
168+ assert_eq ! ( gix_url:: parse( serialized. as_ref( ) ) ?, url) ;
169+ }
164170 Ok ( ( ) )
165171}
You can’t perform that action at this time.
0 commit comments