From 725facb183cccee25816e944ed0db4077296a972 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 6 Nov 2026 23:51:57 +0100 Subject: [PATCH] self_run resume: clearing a missing kept dir is nothing, an unreadable one an error --- crates/mind-body/src/self_run/tests/resume.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/mind-body/src/self_run/tests/resume.rs b/crates/mind-body/src/self_run/tests/resume.rs index 6779e20..db95fd6 100644 --- a/crates/mind-body/src/self_run/tests/resume.rs +++ b/crates/mind-body/src/self_run/tests/resume.rs @@ -290,3 +290,12 @@ fn a_changed_seed_file_or_link_target_changes_the_digest_and_an_identical_copy_d assert!(!spawner_over(state.path(), state.path(), None).kept().unwrap().same_seed); } } + +#[test] +fn clearing_a_kept_directory_that_does_not_exist_is_nothing_and_one_that_cannot_be_read_is_an_error() { + let state = tempfile::tempdir().unwrap(); + let spawner = spawner_over(state.path(), state.path(), None); + spawner.keep(None).expect("no directory is already clear"); + write(&state.path().join("session"), "a file where the directory belongs"); + assert!(spawner.keep(None).is_err(), "a conversation that cannot be cleared is told, not swallowed"); +}