From 3c9e195b3601366993dcb1b27b6b2c12176eefd7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 30 Sep 2026 19:17:40 +0200 Subject: [PATCH] cultcache-rs: pin the text a failed write reports cargo-mutants found no test of what CultCacheStoreWriteFailed says. Both outcomes now assert the path and the outcome in the error text. Co-Authored-By: Claude Opus 5.5 --- packages/cultcache-rs/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/cultcache-rs/src/lib.rs b/packages/cultcache-rs/src/lib.rs index 817ea7dd..7b2f1804 100644 --- a/packages/cultcache-rs/src/lib.rs +++ b/packages/cultcache-rs/src/lib.rs @@ -5319,6 +5319,7 @@ mod tests { .unwrap_err(); assert_eq!(write_failure_kind(&error), Some(CultCacheStoreWriteFailedKind::NotReplaced), "{error:#}"); assert!(io_error_in(&error).is_some(), "{error:#}"); + assert!(error.to_string().contains(&format!("{} was not replaced", path.display())), "{error}"); assert_eq!(fs::read(&path)?, before); assert_eq!(fs::read_dir(temp.path())?.count(), 2, "only the store and its lock remain"); @@ -5346,6 +5347,7 @@ mod tests { }) .unwrap_err(); assert_eq!(write_failure_kind(&error), Some(CultCacheStoreWriteFailedKind::ReplacedNotDurable), "{error:#}"); + assert!(error.to_string().contains(&format!("{} was replaced, but the replacement is not yet durable", path.display())), "{error}"); assert!(io_error_in(&error).is_some(), "{error:#}"); assert_eq!(store.pull_all()?, replacement); Ok(())