Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

ui-egui tests: restore the joined helper (fixes ui-egui test build after #2924 and #2497 both removed one) (#2947)

Brandon Thomas9c90365c4525
diff --git a/crates/ui-egui/src/file_dialog/tests.rs b/crates/ui-egui/src/file_dialog/tests.rs
index eedeb57f0..dc4db4c51 100644
--- a/crates/ui-egui/src/file_dialog/tests.rs
+++ b/crates/ui-egui/src/file_dialog/tests.rs
@@ -292,6 +292,12 @@ fn save_and_export_dialogs_start_beside_the_document() {
}
}
+/// The path `pick_save` suggests for `name` in `dir` on this platform: it joins with `Path::join`,
+/// which uses `\` on Windows, so the expected values must be built the same way (#2745).
+fn joined(dir: &str, name: &str) -> String {
+ std::path::Path::new(dir).join(name).to_string_lossy().into_owned()
+}
+
/// #1826: after the user navigates a save or export dialog elsewhere, the document's next dialog
/// starts there. Save As of a saved document still suggests its own path; other documents and
/// closed documents are unaffected.