Skip to content

Commit

Permalink
fix: replace invalid characters for Windows in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelmmiguel committed Oct 5, 2023
1 parent 4cfc2c5 commit f8d836b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,14 @@ mod test {
let path = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
let cargo_toml = path.join("Cargo.toml");
let cargo_toml_str = if cfg!(target_os = "windows") {
format!("http://localhost:8080/{}", cargo_toml.to_string_lossy()).replace(':', "%3A")
// Actix doesn't allow : and \ characters
// Remove the first two characters (like X:) and the \.
let no_root_path = cargo_toml
.to_string_lossy()
.chars()
.skip(3)
.collect::<String>();
format!("http://localhost:8080/{}", no_root_path).replace('\\', "/")
} else {
format!("http://localhost:8080{}", cargo_toml.to_string_lossy())
};
Expand Down

0 comments on commit f8d836b

Please sign in to comment.