Economy tests: role inputs persist, are read by every rule as any filler, offered recipe-less designs demand their roles

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-27 10:56:21 +01:00
commit ccd9792d2f
5 changed files with 179 additions and 3 deletions

View file

@ -254,6 +254,12 @@ public sealed class EconomyCommandTests
Assert.Contains("commodity:ore <- nothing | Mill, cycle 1, workforce 0 | a good", text);
Assert.Contains("commodity:plate <- 2 x commodity:ore | Mill, cycle 1, workforce 0 | a good", text);
Assert.Contains("gear:laser <- 2 x Plate | Mill", text);
f.Good("ore2", fills: new[] { "OreRole" });
f.Good("steel", roleInputs: new[] { ("OreRole", 2) });
var withRole = new StringWriter();
EconomyCommand.Report(f.Cache, withRole);
Assert.Contains("commodity:steel <- 2 x OreRole | Mill", withRole.ToString());
Assert.Contains("gear:laser <- 2 x Plate | Mill", withRole.ToString());
Assert.True(text.IndexOf("commodity:ore <-", StringComparison.Ordinal) < text.IndexOf("commodity:plate <-", StringComparison.Ordinal));
Assert.True(text.IndexOf("commodity:plate <-", StringComparison.Ordinal) < text.IndexOf("gear:laser <-", StringComparison.Ordinal));
f.EditRecipe("commodity:plate", r => r.LoreHook = "");