Name a read's context its group, route and branches, deleting surveyAt

This commit is contained in:
2026-09-29 21:46:25 +02:00
committed by Lillem4n
parent 9e786ccf39
commit 2b61433258
7 changed files with 67 additions and 69 deletions
+4 -4
View File
@@ -1005,7 +1005,7 @@ func TestEnteredRowsAgreeWithPinning(t *testing.T) {
var none pinSet
for _, entered := range tables {
for row := 0; row < entered.rowCount(); row++ {
whole := surveyAt{}
whole := branches{}
whole.wholePins.add(entered, row)
s := none.entered(entered, row)
for _, cand := range tables {
@@ -1018,14 +1018,14 @@ func TestEnteredRowsAgreeWithPinning(t *testing.T) {
for cr := 0; cr < cand.rowCount(); cr++ {
beside := s.clone()
refused := beside.pinRow(cand, cr) != nil
candAt := surveyAt{pins: none.entered(cand, cr)}
if got := alternatives(surveyAt{pins: s}, candAt); got != refused {
candAt := branches{pins: none.entered(cand, cr)}
if got := alternatives(branches{pins: s}, candAt); got != refused {
t.Errorf("alternatives(%s, %s) = %v, but pinning both refuses = %v", entered.selectorSpelling(row), cand.selectorSpelling(cr), got, refused)
}
if alternatives(whole, candAt) || alternatives(candAt, whole) {
t.Errorf("%s rendered whole is an alternative to %s pinned, though the whole draw ignores the pin", entered.selectorSpelling(row), cand.selectorSpelling(cr))
}
other := surveyAt{}
other := branches{}
other.wholePins.add(cand, cr)
if want := cand == entered && cr != row; alternatives(whole, other) != want {
t.Errorf("alternatives(%s, %s), both rendered whole, = %v, want %v", entered.selectorSpelling(row), cand.selectorSpelling(cr), !want, want)