AetheriaStoresTests: MissingCatalogGlobalIsLoud opens an existing empty catalog

The test relied on a read-only open of a nonexistent file yielding an empty catalog, which
AetheriaStores.Open now refuses; the fixture writes the empty catalog first. Builds; the suite is green with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-10 07:27:31 +02:00
commit 387404c6ea

View file

@ -116,7 +116,9 @@ public sealed class AetheriaStoresTests : IDisposable
public void MissingCatalogGlobalIsLoud()
{
var empty = Path.Combine(_root, "empty.cc");
using (AetheriaStores.Open(empty, catalogWritable: true)) { }
// An existing catalog with no records: a read-only open refuses a missing file before it checks globals.
using (var seed = AetheriaStores.Open(empty, catalogWritable: true)) seed.FlushAsync().Wait();
Assert.True(File.Exists(empty));
var error = Assert.Throws<InvalidOperationException>(() => AetheriaStores.Open(empty));
Assert.Contains("aetheria.tests.catalogglobal", error.Message);
using (AetheriaStores.Open(Catalog)) { }