From cf149c4280e8f5f7708f35b82cd4a1a9162e425d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 12 Oct 2026 07:03:48 +0200 Subject: [PATCH] ValidateJudgesProductsOnADraftAndInspectListsThem: drafts have no model, so validate takes the records-only path the finding names The first version left the package's GLB in place, so validate judged records and model through ReadPackage and the test failed in the mutation baseline. Test-only; builds. Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/ShipProductTests.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ShipProductTests.cs b/tests/Aetheria.Shared.Tests/ShipProductTests.cs index 21b8c8bbc..ee33d49fc 100644 --- a/tests/Aetheria.Shared.Tests/ShipProductTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipProductTests.cs @@ -285,6 +285,12 @@ public sealed class ShipProductTests : IDisposable public void ValidateJudgesProductsOnADraftAndInspectListsThem() { Environment.CurrentDirectory = _root.Path; + // A draft is a package with no model yet: validate then judges its records alone. + string Draft(string path) + { + File.Delete(Path.Combine(Path.GetDirectoryName(path), "skiff.glb")); + return path; + } string Refusal(string path) { var (code, _, error) = Run("validate", path); @@ -292,11 +298,11 @@ public sealed class ShipProductTests : IDisposable return error; } - Assert.Contains("price above 0", Refusal(Package("mod.free", "Free", 0, Product("Free Skiff", _acme, "mod.free")))); - Assert.Contains("needs a name", Refusal(Package("mod.blank", "Blank", 100, Product(" ", _acme, "mod.blank")))); - Assert.Contains("unique", Refusal(Package("mod.twice", "Twice", 100, Product("Same", _acme, "mod.twice"), Product("Same", _rival, "mod.twice")))); + Assert.Contains("price above 0", Refusal(Draft(Package("mod.free", "Free", 0, Product("Free Skiff", _acme, "mod.free"))))); + Assert.Contains("needs a name", Refusal(Draft(Package("mod.blank", "Blank", 100, Product(" ", _acme, "mod.blank"))))); + Assert.Contains("unique", Refusal(Draft(Package("mod.twice", "Twice", 100, Product("Same", _acme, "mod.twice"), Product("Same", _rival, "mod.twice"))))); - var sound = Package("mod.sound", "Sound", 100, Product("Sound Skiff", _acme, "mod.sound"), Product("Sound Rebrand", _rival, "mod.sound")); + var sound = Draft(Package("mod.sound", "Sound", 100, Product("Sound Skiff", _acme, "mod.sound"), Product("Sound Rebrand", _rival, "mod.sound"))); var (validated, output, _) = Run("validate", sound); Assert.Equal(0, validated); Assert.Contains("records only", output);