Skip to content

Pin what printInfo prints and that grid presence matches by id - #84

Merged
dmccoystephenson merged 1 commit into
masterfrom
feature/pin-printinfo-and-grid-presence
Nov 15, 2026
Merged

dmccoystephenson merged 1 commit into
masterfrom
feature/pin-printinfo-and-grid-presence

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • Test 86 pins the exact output of Environment::printInfo(): === <name> === followed by Num entities: <n>, where the name is the current one after setName and <n> counts stored pointers, so an entity added twice is counted twice. The existing Test 28 only checks for substrings.
  • Test 87 pins that Grid::isEntityPresent, called on a standalone Grid, reports a same-id twin of a stored entity as present, and that the lookup leaves the twin's own ids untouched. Until now, presence matching by id was only checked at the Location and Environment level.
  • README.md now states what printInfo() prints (it was not documented anywhere), and the "Entity Identity" section now lists Grid::isEntityPresent and Environment::isEntityPresent among the methods that compare ids.

No production code is changed. This cycle is a Stage B unit-test expansion plus a small Stage A documentation fix. No tracking issue exists, since the open-issue backlog was empty at triage and the gap was found during the coverage sweep.

Test plan

  • make compiles cleanly in the dispatch sandbox
  • CI "Library tests (make + CMake)" runs run_tests.sh and run_tests_asan.sh green on this head, including Tests 86 and 87 (running the binary locally is blocked in this sandbox, so CI is the anchor)

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (anchored on CI run 43679339198, "Library tests (make + CMake)"):

  • Scope: PASS — only src/tests.cpp (two new tests, one capture helper, two registrations) and two README sentences are changed; no production code, no formatting churn.
  • Tests-new: N/A — no public method is added; the PR only adds tests for existing methods.
  • Tests-fix: N/A — no bug fix; both tests characterize current behaviour.
  • Sibling structure: PASS — captureInfo mirrors the existing captureConsoleRepresentation helper, and both tests follow the "Test N - ..." / " --- Success" pattern with sequential numbers 86 and 87.
  • Sibling renames: N/A — nothing is renamed.
  • Docs: PASS — the README ## Classes table is unaffected (no class or method added); the new printInfo() sentence matches src/environment.cpp (two std::endl-terminated lines), and Grid::isEntityPresent / Environment::isEntityPresent do delegate to Location::isEntityPresent, which compares ids.
  • Issue resolution: N/A — no Closes reference; the backlog was empty at triage.
  • Local test suite: PASS — the CI log shows Test 86 and Test 87 printing " --- Success" in both the make run and the AddressSanitizer run, after Test 85, so the full registered list executed.
  • Header/definition parity, include guards: N/A — no header changed.
  • Test registration: PASS — both new functions are called from main() (src/tests.cpp, last two calls before return).

Judgment notes:

  • README.md:58 — the printInfo() sentence is placed in "Grid Layout and Movement" next to printConsoleRepresentation(), since that is where the other console output is described; a separate section was judged unnecessary for one line.
  • src/tests.cpp Test 86 partly overlaps Test 28, which is kept; Test 28 checks substrings on an empty environment, while Test 86 pins the exact string, the renamed environment, and the pointer count with a twice-added entity.

No blocking findings. Local binary execution is blocked in this sandbox, so CI served as the anchor.

This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 2011430 into master Nov 15, 2026
3 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/pin-printinfo-and-grid-presence branch November 15, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant