From ca67e4c7747d9b2289b81bcaaf7fd18a49658a71 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 27 Nov 2026 20:07:44 +0000 Subject: [PATCH] Recent-file probe trial scripts its file in the host file service The probe asks the installed file service, so the trial puts the present file there instead of on disk. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tests.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index 30d327c6f..161a056b6 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -830,15 +830,18 @@ fn missing_recent_is_marked_and_its_error_shows() { /// The existence probe tells present files from missing ones and never touches remote paths. #[test] fn recent_exists_tells_missing_from_present() { - let mut harness = crate::test_harness::harness(Session::new(), Services::default()); + let path = std::path::PathBuf::from("/deckcraft-tests/172/present.deckcraft"); + let files = std::sync::Arc::new(craft::host::ScriptedFiles::new().with_file(&path, Vec::new())); + let mut harness = crate::test_harness::harness_with( + Session::new(), + Services::default(), + egui_kittest::Harness::builder().with_size(egui::vec2(1440.0, 900.0)), + |platform| platform.host = platform.host.with_files(files), + ); let app = harness.state_mut(); - let mut path = std::env::temp_dir(); - path.push(format!("deckcraft-test-172-{}.deckcraft", std::process::id())); - std::fs::write(&path, b"").unwrap(); assert!(app.recent_exists(&path.to_string_lossy()), "the file exists"); assert!(!app.recent_exists("/deckcraft-tests/172/missing.deckcraft")); assert!(app.recent_exists("\\\\server/share/deck.deckcraft"), "UNC paths are never probed"); - std::fs::remove_file(&path).ok(); } /// #339: clicking a language in Review > Language did nothing, and OK didn't mark the text.