Add a quality gate for tests, Clippy, and the model sources

This commit is contained in:
Thorsten Sommer committed 2026-09-13 11:42:10 +02:00
1 parent caf2aba4b9
commit 58b9aa42f9
10 files changed
+484 -7

No files matched your search

+24
View File
@@ -125,6 +125,21 @@ public sealed class ModelFamilyTests
Assert.That(refused?.Message, Does.Contain("more than once"));
}
[Test]
public void ARankNobodyAccountedForIsRefused()
{
//
// The rank is the way past everything the specificity computes, and the sentence next to it
// is the only thing keeping it accountable. The compiler asks for that sentence; this is
// what keeps an empty one from passing for it, because a number without an explanation
// reads as noise to whoever comes next -- and noise is what the computation replaced.
//
var family = new FamilyRankingWithoutSayingWhy();
var refused = Assert.Throws<ArgumentException>(() => _ = family.Rules);
Assert.That(refused?.Message, Does.Contain("specificity gets wrong"));
}
[Test]
public void AFamilyWhichAdjustsRatherThanChoosesStatesAModifier()
{
@@ -250,6 +265,15 @@ public sealed class ModelFamilyTests
}
}
private sealed class FamilyRankingWithoutSayingWhy : ModelFamily
{
public override ModelVendor Vendor => ModelVendor.UNKNOWN;
public override ModelSource Source => new("https://example.invalid/rank", new DateOnly(2026, 9, 13), "A family moving one of its rules by hand without saying what it moves it past.");
protected override void Declare(ModelFamilyBuilder builder) => builder.Rule("thing").Rank(1, " ").Capabilities(Capability.TEXT_INPUT);
}
private sealed class FamilyWithAModifier : ModelFamily
{
public override ModelVendor Vendor => ModelVendor.UNKNOWN;