CultLib/tests/GameCult.Caching.Tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens 9629aa119b C#: a type listing an id registers beside the type that owns it; the owner wins
Batch 9 refused any overlap between two types' ids, which forbade the migration
CompatibleSchemaIds exists for: v2 declares v1's id while v1's class stays
registered (Soul F8). The rule is now owner beats lister. A type owns its own
schema id; any number of types may list an id as compatible beside its owner,
registering in either order. A record under an id resolves to its owner, else to
the one type listing it. An id no type owns and several list names no single
type, so a record under it is refused, typed (CultSchemaConflictException naming
the id and the listers), where it resolves: refusing at registration would
depend on whether the owner had registered yet.

A second owner of one id is still refused at registration, typed. A schema id
hashes the schema's name and version, so the only second owner is a type of the
same name and version, which the name-and-version check already meets; the
separate own-id lookup could never fire and is gone.

Tests: an owner and a lister register in both orders, the owner's id resolves to
the owner, the lister's own id to the lister, and without the owner to the
lister; two listers register in both orders, a record under their id is refused
typed with no owner and resolves to the owner with one, registered before or
after them; a cache with v1 beside v2 reads each version's records as its own
type, in both registration orders. The emitted-fixture note says why a fixture
is emitted now that v1/v2 pairs no longer need hiding from the shared registry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 15:26:06 +02:00
..
Fixtures Mark pre-Cut 2 store fixtures binary 2026-09-13 17:17:49 +02:00
AssemblyInfo.cs Generate derived documents' members and require [Key] on every one 2026-09-13 21:19:08 +02:00
BackingStoreTests.cs Mark the three share-mode tests Windows-only 2026-09-29 04:17:31 +02:00
CompatibleSchemaIdTests.cs C#: a type listing an id registers beside the type that owns it; the owner wins 2026-09-30 15:26:06 +02:00
ConditionalCommitTests.cs Mark every Cult document [MessagePackObject] 2026-09-13 23:38:08 +02:00
CultAssetGuidKeyTests.cs Studio: refuse built-ins by asset identity, not GUID digits; add Clear for stale keys 2026-09-17 20:09:53 +02:00
CultCacheJournalTests.cs Journal registration counts as disposed only once removal succeeds; a throwing hold body surfaces journal failures 2026-09-29 20:35:50 +02:00
CultCacheObserverTests.cs Keep the test frame from holding the subscription it checks the cache released 2026-09-29 20:03:08 +02:00
CultCacheProjectionTests.cs Kill the Stryker survivors in the projection and observer cuts 2026-09-29 17:46:36 +02:00
CultDocumentRegistryTests.cs C#: a type listing an id registers beside the type that owns it; the owner wins 2026-09-30 15:26:06 +02:00
CultDocumentSelectionSurfaceTests.cs R-AL/R-AM/R-AO: C# regression tests for the fix batch 2026-09-23 07:17:21 +02:00
CultInspectorModelTests.cs Cover valid surrogate pairs and a second unpaired surrogate in node ids 2026-09-29 15:49:51 +02:00
CultMathJsonTests.cs Caching: JSON converter and MessagePack formatter for CultPhasor 2026-09-30 02:46:29 +02:00
CultMathSerializationTests.cs Caching: JSON converter and MessagePack formatter for CultPhasor 2026-09-30 02:46:29 +02:00
DirectoryStoreDurabilityTests.cs Mark the three share-mode tests Windows-only 2026-09-29 04:17:31 +02:00
DocumentShapeTests.cs Persist get-only and readonly members the way MessagePack does 2026-09-14 00:21:21 +02:00
ElementIdEngineTests.cs Store readability: one reader decides open, flush, commit and CultMesh writes 2026-09-30 01:59:28 +02:00
ElementIdTests.cs C#: a whole-view write that stores a record differently mints it a later storedAt 2026-09-30 15:25:22 +02:00
EmittedDocumentTypes.cs C#: a type listing an id registers beside the type that owns it; the owner wins 2026-09-30 15:26:06 +02:00
GameCult.Caching.Tests.csproj Delete the CultCache MessagePack source generator 2026-09-13 23:38:08 +02:00
PreCut2FixtureDocuments.cs Mark every Cult document [MessagePackObject] 2026-09-13 23:38:08 +02:00
PreCut2StoreFormatTests.cs Test: the directory store's wrong-format refusal is the typed exception naming the manifest 2026-09-30 08:22:58 +02:00
README.md Delete the CultCache MessagePack source generator 2026-09-13 23:38:08 +02:00
SerializationOptionsTests.cs Write an unset CultRecordRef as "" in every position 2026-09-14 21:34:23 +02:00
StoreReadabilityTests.cs C#: no store writer restamps a record; the directory store has one source of arrived entries 2026-09-30 11:04:12 +02:00
StoreRoutingTests.cs Mark the three share-mode tests Windows-only 2026-09-29 04:17:31 +02:00
VariantTests.cs Store readability: one typed refusal, one full reader, one store shape 2026-09-30 04:06:44 +02:00

GameCult.Caching.Tests

GameCult.Caching.Tests contains NUnit tests for the caching library and its MessagePack persistence stores.

Scope

The tests currently cover:

  • SingleFileMessagePackBackingStore round-trips, external pulls, and the dirty-pull guard
  • DirectoryMessagePackBackingStore with the cultcache.store.v4.directory-content-addressed-pages manifest: page writes, clean flushes, concurrent writers under the commit lease, external deltas, unflushed local keys, orphaned pages, and observers running after the lease is released
  • CultCacheMessagePack.OpenAsync, persisted globals, dirty state, and flush on dispose
  • cache lookups (Get, GetAll, runtime-type upserts)
  • CultCache.Commit batches on a directory store: visibility after the store commits, abandoned stages, sealed batches, observers committing again
  • Cult document payloads, registry shape rejections, canonical schema fixtures, and schema drift reports
  • hand-written MessagePack snapshot and record serialization
  • StoreRoutingTests: the store-composition contract (routing, attachment is hydration, read-only stores, global singletons, assignable lookups, batches, all-or-nothing loads)
  • ConditionalCommitTests: Expect, ExpectUnchanged, TryCommit, the single-file lock, strictly increasing storedAt, and the same conditions on a directory store
  • DirectoryStoreDurabilityTests: failed manifest replace, content-addressed pages, the commit lease, orphan pages and tampered pages, with faults from real file locks
  • PreCut2StoreFormatTests: stores written before Cut 2 still open

Selective hydration, the directory store's stage probes, pre-v4 directory formats, and the SoA table are no longer in the tree; the SoA table is parked at parked/cultcache-soa (docs/parked-features.md).

Run

dotnet test tests\GameCult.Caching.Tests\GameCult.Caching.Tests.csproj