From 7dd19baac38d3cd2b7c501b95c879407c5b774f2 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 30 Sep 2026 20:52:08 +0200 Subject: [PATCH] Test: a store holding a schema the cache does not register opens and carries it The corrupt-store test pinned the old refusal of an unknown schema at open. Under C2a F2 that record is foreign: the store opens, lists it, and opening still rewrites nothing. Co-Authored-By: Claude Opus 5.5 --- tests/GameCult.Caching.Tests/ConditionalCommitTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/GameCult.Caching.Tests/ConditionalCommitTests.cs b/tests/GameCult.Caching.Tests/ConditionalCommitTests.cs index adfd67e3..c586a414 100644 --- a/tests/GameCult.Caching.Tests/ConditionalCommitTests.cs +++ b/tests/GameCult.Caching.Tests/ConditionalCommitTests.cs @@ -659,9 +659,11 @@ namespace GameCult.Caching.Tests writer.FlushAllBackingStores(); } + // A record of a schema this cache does not register is not corruption: the store opens and carries it (ForeignRecordTests). var bytes = File.ReadAllBytes(unknown); using var narrow = new CultCache(CultDocumentRegistry.ForTypes(new[] { typeof(Counter) })); - Assert.That(() => narrow.AddBackingStore(new SingleFileMessagePackBackingStore(unknown)), Throws.Exception, "a store with an unknown schema opened"); + narrow.AddBackingStore(new SingleFileMessagePackBackingStore(unknown)); + Assert.That(narrow.BackingStores.Single().ForeignRecords, Has.Count.EqualTo(1)); Assert.That(File.ReadAllBytes(unknown), Is.EqualTo(bytes), "opening rewrote a store with an unknown schema"); }