From ad153f5ded83fff756417db6f7a3636a55fe19dc Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 12 Nov 2026 21:22:55 +0100 Subject: [PATCH] test(ui): the link test's openDoc path is absolute on Windows too --- crates/ui-egui/src/script_dialog.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/script_dialog.rs b/crates/ui-egui/src/script_dialog.rs index c7ab61e5a5..64251d51de 100644 --- a/crates/ui-egui/src/script_dialog.rs +++ b/crates/ui-egui/src/script_dialog.rs @@ -456,9 +456,12 @@ mod link_script_tests { /// window's prompt, the answer resumes it, and its field change and openDoc consent apply. #[test] fn a_javascript_link_asks_its_menu_and_applies_its_result() { - let script = "getField\\('log'\\).value = app.popUpMenuEx\\({cName:'A', cReturn:'a'}\\) + event.type; app.openDoc\\('/abs/other.pdf'\\);"; + // An absolute path on this system (the document has no folder): on Windows, Acrobat's + // `/C/…` form, which reads as `C:/…`. + let path = if cfg!(windows) { "/C/abs/other.pdf" } else { "/abs/other.pdf" }; + let script = format!("getField\\('log'\\).value = app.popUpMenuEx\\({{cName:'A', cReturn:'a'}}\\) + event.type; app.openDoc\\('{path}'\\);"); let mut app = PdfCraftApp::new(); - app.open_bytes("link.pdf", None, linked(script)).unwrap(); + app.open_bytes("link.pdf", None, linked(&script)).unwrap(); let id = app.active_ids().unwrap().1; app.run_link_script(id, 0, 0); let ctx = egui::Context::default();