Give packs an identity so create can refuse missing deps and load in a stable order.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 00:20:36 +03:00
co-authored by Cursor
parent e5a0ae5b9d
commit 263c94c55d
28 changed files with 851 additions and 56 deletions
@@ -57,6 +57,20 @@ public class CatalogLoaderTests
Assert.Contains(log.Warnings, warning => warning.Contains("Sit") && warning.Contains("addon"));
}
[Fact]
public void UnlabelledDef_WarnsButLoads()
{
var log = new RecordingLog();
var catalog = _loader.Load(
[CatalogLoader.CorePackId],
[PackDocuments.Def(CatalogLoader.CorePackId, "things", "lamp", """{ "defName": "Lamp", "actions": [] }""")],
log);
Assert.True(catalog.Things.ContainsKey("Lamp"));
Assert.Equal("Lamp", catalog.Label("ru", catalog.Things["Lamp"]));
Assert.Contains(log.Warnings, warning => warning.Contains("Lamp", StringComparison.Ordinal));
}
[Fact]
public void Text_FallsBackToTheKeyWhenMissing()
{