Answer architecture round 2: a keyed walk position, a plainer Above test, and docs naming the owner and the key-name refusal

This commit is contained in:
2026-10-05 21:50:00 +02:00
committed by Lillem4n
parent 29a5314f60
commit 36329f1328
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -141,8 +141,8 @@ func (t *Table[O]) appendRow(row string, line int) error {
return nil
}
// bindOptions resolves each option to its column and proves what it claims of the
// cells: a key is unique, a weight a positive number.
// bindOptions resolves each option to its column, refuses a name reading the key column, and
// proves what the options claim of the cells: a key is unique, a weight a positive number.
func (t *Table[O]) bindOptions() error {
o := t.options
if o.Key != "" && o.Key == o.Name {
+1 -1
View File
@@ -110,7 +110,7 @@ func TestDrawInDrawsInsideThePinnedParentAndPinsItsAncestors(t *testing.T) {
if pr := q.MustRow(country); country.Cell(pr, 0) != city.Cell(r, 0) {
t.Fatalf("DrawIn pinned country %s above a city of %s", country.Cell(pr, 0), city.Cell(r, 0))
}
if above := q.Above(country); func() bool { _, ok := above.Pinned(city); return ok }() {
if _, ok := q.Above(country).Pinned(city); ok {
t.Fatal("Above(country) kept the city's pin")
}
}