Pin the one-value refusal on the codec document read and the Mesh single-file read
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Libby 2026-11-12 11:03:29 +00:00
commit ca5613ccb4
2 changed files with 27 additions and 0 deletions

View file

@ -110,6 +110,15 @@ namespace GameCult.Caching.Tests
Assert.That(message, Does.Contain(typeof(UnionSurface).FullName).And.Contain($"1 {Clause}").And.Contain("refused on read"));
}
// The inspector reads documents through CultCodec.Deserialize (type == document), not DecodeDocument: its branch is its own path.
[Test]
public void CodecDeserializeOfADocumentRefusesATail()
{
var codec = CultCacheMessagePack.CreateCodec(Registry);
var message = Message(() => codec.Deserialize(typeof(UnionSurface), typeof(UnionSurface), Base.Concat(new byte[] { 0xc0 }).ToArray()));
Assert.That(message, Does.Contain(typeof(UnionSurface).FullName).And.Contain($"1 {Clause}").And.Contain("refused on read"));
}
[Test]
public void StoreLoadRefuses()
{

View file

@ -58,4 +58,22 @@ public class BytesAfterPathTests
.MakeGenericMethod(typeof(CultMeshCdnArtifactManifest));
Refusal(() => read.Invoke(null, new object[] { snapshot, record.SchemaId, record.RecordKey })).Should().Contain(Clause);
}
[Test]
public void ASingleFileDocumentReadRefusesATail()
{
var path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"cultlib-bytesafter-mesh-{Guid.NewGuid():N}.cc");
try
{
var descriptor = CultDocumentRegistry.Shared.GetRequired<CultMeshCdnArtifactManifest>();
var schema = new CultMeshSingleFileDocumentSchema(descriptor.SchemaId, descriptor.SchemaName, descriptor.SchemaVersion);
var payload = WithTail(Manifest()).Payload;
CultMesh.WriteSingleFileDocumentPayload(path, new CultRecordKey("k"), schema, null, payload);
Refusal(() => CultMesh.ReadSingleFileDocument<CultMeshCdnArtifactManifest>(path, new CultRecordKey("k"))).Should().Contain(Clause);
}
finally
{
System.IO.File.Delete(path);
}
}
}