mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-24 10:09:01 -06:00
Windows: compare exported paths as paths in the same-folder export test
same_folder_as_original_exports_next_to_each_photo compared path strings. The export joins the subfolder with '/', so on Windows it reports C:\...\A/Exports/IMG_1.jpg (a valid path) while the test expected C:\...\A\Exports/IMG_1.jpg. Found by running the tests on windows-latest (gap 9). Test-only change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AbegtYaPuwqZ81pGfELsFK
This commit is contained in:
@@ -991,8 +991,9 @@ fn same_folder_as_original_exports_next_to_each_photo() {
|
||||
let exists = |p: &str| std::path::Path::new(p).exists();
|
||||
let files = crate::export::export_batch(&mut s, &ids, &o, &to, &mut crate::export::write_file, &exists).unwrap();
|
||||
let written: Vec<&str> = files.iter().map(|f| f["path"].as_str().unwrap()).collect();
|
||||
let mut want = vec![a.join("Exports/IMG_1.jpg").to_string_lossy().to_string(), b.join("Exports/IMG_1.jpg").to_string_lossy().to_string()];
|
||||
let mut got: Vec<String> = written.iter().map(|p| p.to_string()).collect();
|
||||
// compared as paths: on Windows the export joins the subfolder with `/`, which `Path` treats as `\`
|
||||
let mut want = vec![a.join("Exports").join("IMG_1.jpg"), b.join("Exports").join("IMG_1.jpg")];
|
||||
let mut got: Vec<std::path::PathBuf> = written.iter().map(std::path::PathBuf::from).collect();
|
||||
want.sort();
|
||||
got.sort();
|
||||
assert_eq!(got, want);
|
||||
|
||||
Reference in New Issue
Block a user