From 7f9e967ad0d5becba175ebb0b3054ed6808a79da Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 23:20:12 +0200 Subject: [PATCH] test(reconcile): a verdict returned with an error is not used Mutation-testing showed the forced-unsure line was untested because my fake always returned unsure with its errors. Co-Authored-By: Claude Sonnet 5.5 --- internal/reconcile/reconcile_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/reconcile/reconcile_test.go b/internal/reconcile/reconcile_test.go index c6b5308..ec85af8 100644 --- a/internal/reconcile/reconcile_test.go +++ b/internal/reconcile/reconcile_test.go @@ -277,3 +277,17 @@ func TestReconcile_ContestedSpotsAreCappedButTheCountsAreExact(t *testing.T) { assert.Equal(t, 300, out.Reconciliation.Disputes) assert.Len(t, out.Reconciliation.Contested, reconcile.MaxContested, "the stored list is bounded; the counts are not") } + +func TestReconcile_AVerdictReturnedAlongsideAnErrorIsIgnored(t *testing.T) { + // An adjudicator that returns a verdict AND an error must not have the verdict used: + // the contract is that an error means no decision. + adj := &scripted{fn: func(int, reconcile.Request) (reconcile.Verdict, error) { + return reconcile.VerdictAlt, errors.New("half a reply") + }} + + out := merge(t, tr("a x b"), tr("a y b"), adj) + + assert.Equal(t, "a x b", out.Text, "no decision means the base stands") + assert.Zero(t, out.Reconciliation.Changed) + assert.Equal(t, 1, out.Reconciliation.Unsure) +}