Skip to content

Commit

Permalink
Add a test default port number when changing scheme.
Browse files Browse the repository at this point in the history
Closes #61. (It was fixed by #176.)
  • Loading branch information
SimonSapin committed Apr 21, 2016
1 parent bb72f19 commit 1c2f149
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,13 @@ fn issue_25() {
let expected = format!("postgres://me@/{}run/pg.sock", if cfg!(windows) { "C:/" } else { "" });
assert_eq!(url.as_str(), expected);
}

#[test]
/// https://github.com/servo/rust-url/issues/61
fn issue_61() {
let mut url = Url::parse("http://mozilla.org").unwrap();
url.set_scheme("https").unwrap();
assert_eq!(url.port(), None);
assert_eq!(url.port_or_known_default(), Some(443));
url.assert_invariants();
}

0 comments on commit 1c2f149

Please sign in to comment.