A removal of a section removed already is refused: the case ADR 0642 names, as a test

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 23:17:22 +01:00
parent b3fc5b4580
commit 80f992e367
@@ -252,4 +252,22 @@ func TestRegisteredSectionEdgeCases(t *testing.T) {
t.Errorf("the changed registered text was swallowed by the old approval:\n%s", got)
}
})
t.Run("TestARemovalOfARemovedSectionIsRefused", func(t *testing.T) {
p, _ := node(t, "g14")
register(t, p, "registered")
store, r := &memProposals{m: map[string]json.RawMessage{}}, newRouter()
in := ProposeInput{Scope: ScopeMesh, Name: name, Remove: true}
out, err := Propose(p, in, store, r, t0)
if err != nil {
t.Fatal(err)
}
id := out["proposed"].(string)
r.close(r.chose(id, OptionApprove, t0.Add(time.Hour)))
if _, _, err := Reconcile(p, store, r, nil, t0.Add(time.Hour)); err != nil {
t.Fatal(err)
}
if _, err := Propose(p, in, store, r, t0.Add(2*time.Hour)); err == nil || !strings.Contains(err.Error(), "removed already") {
t.Errorf("a removed section was removed again: %v", err)
}
})
}