Skip to content

Commit a51db59

Browse files
committed
Fix tests
1 parent 29a34c3 commit a51db59

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/web/sitemap.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ mod tests {
142142
wrapper(|env| {
143143
let web = env.frontend();
144144
for file in std::fs::read_dir("templates/core/about")? {
145-
assert_success(path?, web)?;
145+
use std::ffi::OsStr;
146+
147+
let file_path = file?.path();
148+
if file_path.extension() != Some(OsStr::new("html"))
149+
|| file_path.file_stem() == Some(OsStr::new("index"))
150+
{
151+
continue;
152+
}
153+
let filename = file_path.file_stem().unwrap().to_str().unwrap();
154+
let path = format!("/about/{}", filename);
155+
assert_success(&path, web)?;
146156
}
147157
assert_success("/about", web)
148158
})

0 commit comments

Comments
 (0)