Skip to content

Commit 1c2f149

Browse files
committed
Add a test default port number when changing scheme.
Closes #61. (It was fixed by #176.)
1 parent bb72f19 commit 1c2f149

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/unit.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,13 @@ fn issue_25() {
249249
let expected = format!("postgres://me@/{}run/pg.sock", if cfg!(windows) { "C:/" } else { "" });
250250
assert_eq!(url.as_str(), expected);
251251
}
252+
253+
#[test]
254+
/// https://github.com/servo/rust-url/issues/61
255+
fn issue_61() {
256+
let mut url = Url::parse("http://mozilla.org").unwrap();
257+
url.set_scheme("https").unwrap();
258+
assert_eq!(url.port(), None);
259+
assert_eq!(url.port_or_known_default(), Some(443));
260+
url.assert_invariants();
261+
}

0 commit comments

Comments
 (0)