mirror of
https://github.com/storytold/deckcraft.git
synced 2026-12-01 10:47:56 +01:00
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
3b3094e15f
commit
ca67e4c774
1 file changed
+8
-5
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user