Address #128 review: doc lines and an exact position assertion
Build image / build-and-push (push) Successful in 7s

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
2026-08-23 00:43:15 -04:00
co-authored by Claude Fable 5
parent 8b161c5f6d
commit 85b7dbbe3a
2 changed files with 14 additions and 9 deletions
+9 -3
View File
@@ -628,14 +628,20 @@ func TestDescribeGardenGroupsByPlant(t *testing.T) {
if want := 2*derivedCount(20, 25) + 3; ba.Plants != want {
t.Errorf("basil plants = %d, want %d", ba.Plants, want)
}
// The position is what lets a move keep the layout; "south" alone can't. The
// three basil plops were placed at exactly these local points.
placedAt := map[[2]float64]bool{{-100, 100}: true, {0, 150}: true, {100, 100}: true}
for _, e := range ba.Each {
if e.PlantedAt == "" || e.Version == 0 || e.ID == 0 {
t.Errorf("listed plop %+v is missing id, version or date", e)
}
// The position is what lets a move keep the layout; "south" alone can't.
if e.YCM < 100 || (e.XCM != -100 && e.XCM != 0 && e.XCM != 100) {
t.Errorf("listed plop %+v doesn't carry the position it was placed at", e)
if !placedAt[[2]float64{e.XCM, e.YCM}] {
t.Errorf("listed plop %+v is not at a position a basil was placed at", e)
}
delete(placedAt, [2]float64{e.XCM, e.YCM})
}
if len(placedAt) != 0 {
t.Errorf("positions never listed: %v", placedAt)
}
// The big group's ids are a call away, narrowed to one plant.