Repository navigation
Add tests pinning grid layout and directional movement - #68
Merged
Merged
Conversation
Cover the location id format and row-by-row generation order, setId/setSize leaving existing locations alone, off-grid moves returning false from both corners, and each direction following y-down coordinates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (anchor: CI "Library tests (make + CMake)" job, run 41014552214, where the log shows Tests 1–56 each followed by
Findings:
No blocking findings. This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage B (unit-test expansion) cycle for the README's "Grid Layout and Movement" contract. The existing directional-move tests place the entity at a random location and accept either outcome, so the off-grid
falsepath and the y-down direction mapping were never asserted deterministically. The location id format and generation order were also untested.Four characterization tests were added to
src/tests.cppand registered inmain():Grid(3, 3)generates locations row by row (y outer, x inner), with ids of the form<gridId>-<x>-<y>.Grid::setIdandGrid::setSizeonly overwrite the stored values. The location count and ids stay as generated.(0,0)and off the bottom/right edge from(2,2)returnfalseand leave the entity in place.(1,1), up →0-1-0, right →0-2-0, down →0-2-1, left →0-1-1, each returningtrue.No production code is changed. No tracking issue exists: the gap was found during triage, when the open-issue backlog was empty.
Test plan
makecompiles cleanly with the new tests.bash run_tests.shcannot be run in this session, 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