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 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 23:19:22 +02:00
co-authored by Claude Sonnet 5.5
parent b20558ffa6
commit a1e16fa658
+10 -10
View File
@@ -123,10 +123,10 @@ func TestReconcile_SeveralDisputesAreAppliedIndependentlyAndInOrder(t *testing.T
return reconcile.VerdictBase, nil return reconcile.VerdictBase, nil
}} }}
out := merge(t, tr("kunderna onboardade nu och sen betalas till SEB med 1050 kronor"), 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 med 2050 kronor"), adj) 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, 3, out.Reconciliation.Disputes)
assert.Equal(t, 2, out.Reconciliation.Changed) assert.Equal(t, 2, out.Reconciliation.Changed)
} }
@@ -134,7 +134,7 @@ func TestReconcile_SeveralDisputesAreAppliedIndependentlyAndInOrder(t *testing.T
func TestReconcile_TheReadingOrderAlternatesFromOneDisputeToTheNext(t *testing.T) { func TestReconcile_TheReadingOrderAlternatesFromOneDisputeToTheNext(t *testing.T) {
adj := always(reconcile.VerdictBase) 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) require.Len(t, adj.calls, 3)
assert.False(t, adj.calls[0].AltFirst) assert.False(t, adj.calls[0].AltFirst)
@@ -166,9 +166,9 @@ func TestReconcile_OneModelErrorLeavesThatSpotUnsureAndCarriesOn(t *testing.T) {
return reconcile.VerdictAlt, nil 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.Errors)
assert.Equal(t, 1, out.Reconciliation.Unsure) assert.Equal(t, 1, out.Reconciliation.Unsure)
assert.Equal(t, domain.ReconcileDone, out.Reconciliation.Status) 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 }} adj := &scripted{fn: func(int, reconcile.Request) (reconcile.Verdict, error) { return reconcile.VerdictUnsure, boom }}
a, b := make([]string, 0, 20), make([]string, 0, 20) a, b := make([]string, 0, 20), make([]string, 0, 20)
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
a = append(a, fmt.Sprintf("w%d", i), "same") a = append(a, fmt.Sprintf("w%d", i), "s", "t")
b = append(b, fmt.Sprintf("v%d", i), "same") b = append(b, fmt.Sprintf("v%d", i), "s", "t")
} }
out := merge(t, tr(strings.Join(a, " ")), tr(strings.Join(b, " ")), adj) 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) a, b := make([]string, 0, 20), make([]string, 0, 20)
for i := 0; i < 9; i++ { for i := 0; i < 9; i++ {
a = append(a, fmt.Sprintf("w%d", i), "same") a = append(a, fmt.Sprintf("w%d", i), "s", "t")
b = append(b, fmt.Sprintf("v%d", i), "same") b = append(b, fmt.Sprintf("v%d", i), "s", "t")
} }
out := merge(t, tr(strings.Join(a, " ")), tr(strings.Join(b, " ")), adj) out := merge(t, tr(strings.Join(a, " ")), tr(strings.Join(b, " ")), adj)