Skip to content

Commit

Permalink
Adjust tests to match correct trailing slash behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamwil committed Apr 26, 2024
1 parent d6f49a5 commit 551c2f9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/cmd/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,6 @@ mod tests {
assert!(!permalink_url.path().starts_with("//"));
assert!(!permalink_url.path().ends_with("//"));
assert!(permalink_url.path().starts_with("/"));
assert!(permalink_url.path().ends_with("/"));
assert!(permalink_url.path().starts_with(base_url.path()));
}
}
Expand All @@ -1048,7 +1047,7 @@ mod tests {
let base_url: Option<String> = None;
let no_port_append = false;
let ws_port: Option<u16> = None;
let expected_base_url = String::from("http://127.0.0.1:1111/");
let expected_base_url = String::from("http://127.0.0.1:1111");

create_and_verify_new_site(
interface,
Expand All @@ -1069,7 +1068,7 @@ mod tests {
let base_url: Option<String> = Some(String::from("localhost/path/to/site"));
let no_port_append = false;
let ws_port: Option<u16> = None;
let expected_base_url = String::from("http://localhost:1111/path/to/site/");
let expected_base_url = String::from("http://localhost:1111/path/to/site");

create_and_verify_new_site(
interface,
Expand All @@ -1090,7 +1089,7 @@ mod tests {
let base_url: Option<String> = Some(String::from("example.com"));
let no_port_append = true;
let ws_port: Option<u16> = None;
let expected_base_url = String::from("http://example.com/");
let expected_base_url = String::from("http://example.com");

// Note that no_port_append only works if we define a base_url

Expand All @@ -1113,7 +1112,7 @@ mod tests {
let base_url: Option<String> = Some(String::from("https://example.com"));
let no_port_append = true;
let ws_port: Option<u16> = None;
let expected_base_url = String::from("https://example.com/");
let expected_base_url = String::from("https://example.com");

// Note that no_port_append only works if we define a base_url

Expand All @@ -1136,7 +1135,7 @@ mod tests {
let base_url: Option<String> = Some(String::from("https://example.com/path/to/site"));
let no_port_append = true;
let ws_port: Option<u16> = None;
let expected_base_url = String::from("https://example.com/path/to/site/");
let expected_base_url = String::from("https://example.com/path/to/site");

// Note that no_port_append only works if we define a base_url

Expand All @@ -1159,7 +1158,7 @@ mod tests {
let base_url: Option<String> = Some(String::from("https://example.com/path/to/site"));
let no_port_append = false;
let ws_port: Option<u16> = None;
let expected_base_url = String::from("https://example.com:1111/path/to/site/");
let expected_base_url = String::from("https://example.com:1111/path/to/site");

// Note that no_port_append only works if we define a base_url

Expand Down

0 comments on commit 551c2f9

Please sign in to comment.