Boss tests: fixed Loadout bosses, refusals, loadout-commit tests; "Lucent" is "Lucent Media" (builds not yet checked)

RunGoalTests rewritten for Loadouts.BossOf (the three h1 failures were the fixture name "Lucent" against the shipped
"Lucent Media"). LoadoutCommitCommandTests covers the command, its refusals and the maker's boss end to end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-18 18:32:37 +02:00
commit e385e7ce0e
3 changed files with 449 additions and 31 deletions

View file

@ -20,20 +20,21 @@ public static class LoadoutCommitCommand
{
private const string Usage = "usage: loadout-commit <name> <hull product> [<x>,<y>,<rotation>,<design>[@<product>]]... [--group <i>,<j>...]... [--replace]";
public static int Run(string[] args, string root = null)
public static int Run(string[] args, string root = null, TextWriter output = null)
{
output ??= Console.Out;
try
{
return Commit(args, root);
return Commit(args, root, output);
}
catch (Exception e) when (e is InvalidOperationException or ArgumentException or FormatException)
{
Console.WriteLine($"refused: {e.Message}");
output.WriteLine($"refused: {e.Message}");
return 1;
}
}
private static int Commit(string[] args, string root)
private static int Commit(string[] args, string root, TextWriter output)
{
var replace = false;
var groups = new List<int[]>();
@ -51,7 +52,7 @@ public static class LoadoutCommitCommand
if (positional.Count < 2)
{
Console.WriteLine(Usage);
output.WriteLine(Usage);
return 1;
}
@ -72,7 +73,7 @@ public static class LoadoutCommitCommand
if (!Loadouts.Commit(catalogPath, loadout, replace))
throw new InvalidOperationException("the catalog changed since it was read; nothing was written");
Console.WriteLine($"{loadout.Name}: committed, hull {hull.Name} ({product.Name}), {slots} slots");
output.WriteLine($"{loadout.Name}: committed, hull {hull.Name} ({product.Name}), {slots} slots");
return 0;
}