Skip to content

Commit

Permalink
url: test more url fields in wpt parse test
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwuelker committed Jul 24, 2024
1 parent 88bd54c commit c0103e1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions crates/url/tests/parse_wpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn main() -> Result<(), Error> {
};
let base = base_str.map(|s| s.parse().unwrap());
let url = URL::parse_with_base(input, base.clone(), None);
let succeeded;
let mut succeeded = true;

// Start test output
print!("{:?}", input.escape_debug().collect::<String>());
Expand Down Expand Up @@ -60,18 +60,16 @@ fn main() -> Result<(), Error> {
match url {
Ok(url) => {
// FIXME compare all the values here
let _ = url;
succeeded &= url.scheme() == &protocol[..protocol.len() - 1];
succeeded &= url.username() == username;
succeeded &= url.password() == password;
succeeded &= url.port().map(|p| p.to_string()).unwrap_or_default() == port;

let _ = href;
let _ = origin;
let _ = protocol;
let _ = username;
let _ = password;
let _ = host;
let _ = hostname;
let _ = port;
let _ = pathname;

succeeded = true;
},
Err(_) => {
succeeded = false;
Expand Down

0 comments on commit c0103e1

Please sign in to comment.