From 2fbdf514cee061fb2687c5c0d0a6f2c29572d878 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 30 Sep 2026 08:26:27 +0200 Subject: [PATCH] Test: the registry resolves a persisted id to the entry that owns it The vector test alone did not distinguish the order on C#: the compatible entry's own list reached the same local schema. Co-Authored-By: Claude Sonnet 5.5 --- .../StoreReadabilityTests.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs b/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs index d80ee40d..d6931b69 100644 --- a/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs +++ b/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs @@ -166,6 +166,23 @@ namespace GameCult.Caching.Tests Assert.That(cache.Get(new CultRecordKey("alpha")), Is.Not.Null, "the record read as the schema that owns its id"); } + // The registry resolves a persisted id to the entry that owns it, not to one listed earlier that lists it as compatible. + [Test] + public void ThePersistedSchemaAnIdNamesIsTheEntryThatOwnsIt() + { + CultSchemaCatalogEntry Entry(string id, string name, params string[] compatible) => new() + { + SchemaId = id, SchemaName = name, SchemaVersion = name + ".v1", ContentHash = id, CompatibleSchemaIds = compatible + }; + var catalog = new[] + { + Entry("x.lists", "tests.element_id_deck", "x.own"), + Entry("x.own", "vectors.item", "x.own") + }; + + Assert.That(Registry.ResolvePersistedSchemaReport("x.own", catalog).LocalSchemaName, Is.EqualTo("vectors.item")); + } + // A directory rewrite where the entry that lists a kept record's id shares its own id with the schema being written keeps that // id in the entry it writes, so the manifest still reads. [Test]