C# write set tests: fix the five tests the first run named, and the Mesh test's catalog comparison

The unconditional-commit last-writer-wins test now keeps another writer's record; the load-minted ids
stay for MintElementIds after an unconditional write; a detached store marks the variant it writes, not
the one it copies; a variant write supplies the indexed override; the conditional/unconditional
comparison uses one batch (a conditional commit refuses staged writes by design).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-03 03:20:17 +02:00
commit 88934bcb76
5 changed files with 56 additions and 19 deletions

View file

@ -110,6 +110,12 @@ public sealed class CultMeshSingleFileStoreTests
}
}
private static byte[] EntryBytes(CultPersistedStoreSnapshot snapshot, string schemaId) =>
CultDocumentMessagePackSerialization.SerializeSnapshot(new CultPersistedStoreSnapshot
{
SchemaCatalog = snapshot.SchemaCatalog.Where(entry => entry.SchemaId == schemaId).ToArray()
});
private static CultPersistedStoreSnapshot Snapshot(string path) =>
CultDocumentMessagePackSerialization.DeserializeSnapshot(File.ReadAllBytes(path));
@ -141,7 +147,7 @@ public sealed class CultMeshSingleFileStoreTests
kept.Payload.Should().Equal(was.Payload);
}
after.SchemaCatalog.Single(entry => entry.SchemaId == SchemaId()).RawBytes.Should().Equal(before.SchemaCatalog.Single(entry => entry.SchemaId == SchemaId()).RawBytes);
EntryBytes(after, SchemaId()).Should().Equal(EntryBytes(before, SchemaId()));
after.SchemaCatalog.Should().Contain(entry => entry.SchemaId == "raw:schema");
CultMesh.WriteSingleFileDocumentPayload(path, Key, Raw, null, new byte[] { 0x91, 0x01 });