From 36acb4295ad0f079663c343bd94f45a969692c26 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 29 Sep 2026 20:04:59 +0200 Subject: [PATCH] Reach the empty admission through a commit that removes nothing Attaching a store with no file never calls Loaded, so it did not exercise the rule; a commit removing a key the cache does not hold admits nothing. Co-Authored-By: Claude Opus 5.5 --- tests/GameCult.Caching.Tests/CultCacheJournalTests.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/GameCult.Caching.Tests/CultCacheJournalTests.cs b/tests/GameCult.Caching.Tests/CultCacheJournalTests.cs index 287af93b..96e04d5f 100644 --- a/tests/GameCult.Caching.Tests/CultCacheJournalTests.cs +++ b/tests/GameCult.Caching.Tests/CultCacheJournalTests.cs @@ -120,15 +120,14 @@ namespace GameCult.Caching.Tests } [Test] - public void AJournalIsCalledForAnAdmissionThatChangedSomethingAndNeverForOneThatDidNot() + public void AnAdmissionThatChangesNothingIsNotJournaled() { using var cache = Memory(); var calls = 0; using var journal = cache.AddJournal(_ => calls++); - // Attaching a store with nothing in it is an admission with no change. - cache.AddBackingStore(new SingleFileMessagePackBackingStore(Path.Combine(_directory, "empty.cc"))); - Assert.That(cache.Remove(KeyOf("absent")), Is.False); + // Removing a record the cache does not hold is a commit that admits nothing. + cache.Commit(batch => batch.Remove(KeyOf("absent"))); Assert.That(calls, Is.Zero); }