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 ceb1878 commit e62b50f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit.rs
Expand Up @@ -247,3 +247,12 @@ fn issue_25() {
url.assert_invariants();
assert_eq!(url.as_str(), "postgres://me@/run/pg.socket")
}

#[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))
}

0 comments on commit e62b50f

Please sign in to comment.