add a test for the port check skip

This commit is contained in:
dece 2021-06-11 02:24:48 +02:00
parent 2f52157c73
commit da584ef214

View file

@ -372,6 +372,25 @@ fn port_check() {
assert_eq!(page.header.status, Status::ProxyRequestRefused);
}
#[test]
/// - port is not checked if the skip option is passed.
fn port_check_skipped() {
let page = get(
&[
"--addr",
"[::]:19720",
"--hostname",
"example.org",
"--skip-port-check",
],
addr(19720),
"gemini://example.org:1971/",
)
.expect("could not get page");
assert_eq!(page.header.status, Status::Success);
}
#[test]
/// - status for paths with hidden segments is "gone" if file does not exist
fn secret_nonexistent() {