From 20be80cc239ac7bd5862b392a26c390ec1504c38 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 28 Oct 2026 05:16:32 +0100 Subject: [PATCH] Restore the codec-less variant test's cache; the one-batch retype test keeps the replacement through a later add of the batch Co-Authored-By: Claude Opus 5.5 --- tests/GameCult.Caching.Tests/VariantTests.cs | 2 +- tests/GameCult.Caching.Tests/WriteOwnershipTests.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/GameCult.Caching.Tests/VariantTests.cs b/tests/GameCult.Caching.Tests/VariantTests.cs index 62255b12..8f574cd1 100644 --- a/tests/GameCult.Caching.Tests/VariantTests.cs +++ b/tests/GameCult.Caching.Tests/VariantTests.cs @@ -418,7 +418,7 @@ namespace GameCult.Caching.Tests [Test] public void ACacheWithoutACodecHoldsNoVariants() { - using var cache = new CultCache(Registry, CultCacheMessagePack.CreateCodec(Registry)); + using var cache = new CultCache(Registry); cache.Commit(batch => batch.Upsert(typeof(VariantGear), Laser(), BaseKey)); var error = Refused(() => cache.UpsertVariantAsync(BigKey, BaseKey).GetAwaiter().GetResult()); Assert.That(error.Message, Does.Contain(BigKey.Value).And.Contain("codec")); diff --git a/tests/GameCult.Caching.Tests/WriteOwnershipTests.cs b/tests/GameCult.Caching.Tests/WriteOwnershipTests.cs index ff975a51..0728e6f1 100644 --- a/tests/GameCult.Caching.Tests/WriteOwnershipTests.cs +++ b/tests/GameCult.Caching.Tests/WriteOwnershipTests.cs @@ -265,8 +265,9 @@ namespace GameCult.Caching.Tests Assert.That(cache.Commit(batch => { batch.Remove(K2); + batch.Upsert(new WoB { Name = "k2", Value = 8 }, new CultRecordHandle(K2)); batch.Upsert(new WoA { Name = "k2", Value = 9 }, new CultRecordHandle(K2)); - }), Is.True); + }), Is.True, "the key stays a replacement through a later add of the same batch"); Assert.That(cache.GetStored(K2)!.Descriptor.DocumentType, Is.EqualTo(typeof(WoA))); }