Skip to content

Commit

Permalink
I don't know why this test is only sometimes an issue but 🤷‍♂️
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Nov 6, 2022
1 parent 950da5d commit 8895399
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pagefind/src/fossick/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ mod tests {

use super::*;

#[cfg(not(target_os = "windows"))]
#[test]
fn building_url() {
std::env::set_var("PAGEFIND_SOURCE", "hello/world");
Expand All @@ -289,12 +290,18 @@ mod tests {

#[cfg(target_os = "windows")]
#[test]
fn windows_url() {
fn building_windows_urls() {
std::env::set_var("PAGEFIND_SOURCE", "C:\\hello\\world");
let config =
PagefindInboundConfig::with_layers(&[Layer::Env(Some("PAGEFIND_".into()))]).unwrap();
let opts = SearchOptions::load(config).unwrap();

let p: PathBuf = "C:\\hello\\world\\index.html".into();
assert_eq!(&build_url(&p, &opts), "/");

let p: PathBuf = "C:\\hello\\world\\about\\index.html".into();
assert_eq!(&build_url(&p, &opts), "/about/");

let p: PathBuf = "C:\\hello\\world\\about\\index.htm".into();
assert_eq!(&build_url(&p, &opts), "/about/index.htm");
}
Expand Down

0 comments on commit 8895399

Please sign in to comment.