From a1e16fa6580a9d0d83661a9cfeb8ee10b062265a Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 23:19:22 +0200 Subject: [PATCH] test(reconcile): fixtures need two shared words between disputes Disputes separated by a single shared word are merged into one decision by design, so several of my fixtures were secretly one dispute. Corrected before any implementation existed; the rule is unchanged. Co-Authored-By: Claude Sonnet 5.5 --- internal/reconcile/reconcile_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/reconcile/reconcile_test.go b/internal/reconcile/reconcile_test.go index d97a44f..c6b5308 100644 --- a/internal/reconcile/reconcile_test.go +++ b/internal/reconcile/reconcile_test.go @@ -123,10 +123,10 @@ func TestReconcile_SeveralDisputesAreAppliedIndependentlyAndInOrder(t *testing.T return reconcile.VerdictBase, nil }} - out := merge(t, tr("kunderna onboardade nu och sen betalas till SEB med 1050 kronor"), - tr("kunderna omvårdade nu och sen betalas till SCB med 2050 kronor"), adj) + out := merge(t, tr("kunderna onboardade nu och sen betalas till SEB via ombud med 1050 kronor"), + tr("kunderna omvårdade nu och sen betalas till SCB via ombud med 2050 kronor"), adj) - assert.Equal(t, "kunderna omvårdade nu och sen betalas till SCB med 1050 kronor", out.Text) + assert.Equal(t, "kunderna omvårdade nu och sen betalas till SCB via ombud med 1050 kronor", out.Text) assert.Equal(t, 3, out.Reconciliation.Disputes) assert.Equal(t, 2, out.Reconciliation.Changed) } @@ -134,7 +134,7 @@ func TestReconcile_SeveralDisputesAreAppliedIndependentlyAndInOrder(t *testing.T func TestReconcile_TheReadingOrderAlternatesFromOneDisputeToTheNext(t *testing.T) { adj := always(reconcile.VerdictBase) - merge(t, tr("a x b y c z d"), tr("a p b q c r d"), adj) + merge(t, tr("a x s1 s2 y t1 t2 z d"), tr("a p s1 s2 q t1 t2 r d"), adj) require.Len(t, adj.calls, 3) assert.False(t, adj.calls[0].AltFirst) @@ -166,9 +166,9 @@ func TestReconcile_OneModelErrorLeavesThatSpotUnsureAndCarriesOn(t *testing.T) { return reconcile.VerdictAlt, nil }} - out := merge(t, tr("a x b y c"), tr("a p b q c"), adj) + out := merge(t, tr("a x s1 s2 y c"), tr("a p s1 s2 q c"), adj) - assert.Equal(t, "a x b q c", out.Text, "the first spot stayed as the base, the second was decided") + assert.Equal(t, "a x s1 s2 q c", out.Text, "the first spot stayed as the base, the second was decided") assert.Equal(t, 1, out.Reconciliation.Errors) assert.Equal(t, 1, out.Reconciliation.Unsure) assert.Equal(t, domain.ReconcileDone, out.Reconciliation.Status) @@ -179,8 +179,8 @@ func TestReconcile_ConsecutiveModelErrorsStopTheWholeReconciliationInsteadOfWait adj := &scripted{fn: func(int, reconcile.Request) (reconcile.Verdict, error) { return reconcile.VerdictUnsure, boom }} a, b := make([]string, 0, 20), make([]string, 0, 20) for i := 0; i < 10; i++ { - a = append(a, fmt.Sprintf("w%d", i), "same") - b = append(b, fmt.Sprintf("v%d", i), "same") + a = append(a, fmt.Sprintf("w%d", i), "s", "t") + b = append(b, fmt.Sprintf("v%d", i), "s", "t") } out := merge(t, tr(strings.Join(a, " ")), tr(strings.Join(b, " ")), adj) @@ -201,8 +201,8 @@ func TestReconcile_ASuccessBetweenFailuresResetsTheBreaker(t *testing.T) { }} a, b := make([]string, 0, 20), make([]string, 0, 20) for i := 0; i < 9; i++ { - a = append(a, fmt.Sprintf("w%d", i), "same") - b = append(b, fmt.Sprintf("v%d", i), "same") + a = append(a, fmt.Sprintf("w%d", i), "s", "t") + b = append(b, fmt.Sprintf("v%d", i), "s", "t") } out := merge(t, tr(strings.Join(a, " ")), tr(strings.Join(b, " ")), adj)