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:
@@ -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 {
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user