Store readability: one typed refusal, one full reader, one store shape
CultStoreUnreadableException (a NotSupportedException) is the one refusal for a store file this runtime cannot read, thrown by the single-file reader, the rewriting paths and CultMesh's reads, with the cause as the inner exception. The reader is exactly one array of three slots (or an empty array): a header alone and an extra top-level slot are refused instead of read as empty or skipped. CultMesh's older-catalog fallback is the same reader with the older entry reader, so it also requires one array. Vectors: bad-body, header-only, missing-schema, variant-slot, extra-top-slot in the readability set, and a legacy-catalog store with and without bytes after it for CultMesh. The persistence contract says what is true. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e18624f72b
commit
436eed73e4
23 changed files with 186 additions and 84 deletions
|
|
@ -77,8 +77,16 @@ public sealed class CultMeshSingleFileReadabilityTests
|
|||
continue;
|
||||
}
|
||||
|
||||
Assert.That(() => write(path), Throws.Exception, name);
|
||||
Assert.That(() => write(path), Throws.TypeOf<CultStoreUnreadableException>(), name);
|
||||
File.ReadAllBytes(path).Should().Equal(bytes, name + " rewrote a file this runtime cannot read");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EveryVectorInTheFolderHasAManifestRow()
|
||||
{
|
||||
var rows = Vectors().Select(row => (string)row.Arguments[0]).Where(name => !name.StartsWith("..", StringComparison.Ordinal)).OrderBy(name => name, StringComparer.Ordinal);
|
||||
var files = Directory.GetFiles(VectorRoot(), "*.bin").Select(Path.GetFileName).OrderBy(name => name, StringComparer.Ordinal);
|
||||
rows.Should().Equal(files);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue