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) +}