Repository navigation
test: pin that zero and negative draw sizes paint nothing - #59
Conversation
drawRectangle, drawButton and drawImage all paint nothing for a zero width or height; drawRectangle and drawButton also paint nothing for a negative one (it is not mirrored into a normal rectangle), and a button sized either way has no clickable coordinate. drawImage instead raises ValueError on a negative size, which its docstring and the README did not mention -- document it alongside the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The box is skipped at a zero or negative size, but the label is drawn by drawText regardless, so "draws nothing" was wrong for a button with a non-empty label. Say "draws no shape" instead and pin the label case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Self-review rubric (head 026e77b):
Out-of-diff observation: the class docstring's clipping paragraph does not mention degenerate sizes. The README now covers them, and the class docstring was left alone to keep the diff small. Merge readiness: no do-not-auto-merge path is touched. Because this PR changes test files and the 3.9 slot is UNVERIFIED, it is held for a maintainer rather than auto-merged. Once #60 is resolved (or the maintainer accepts the 3.10–3.13 evidence, plus the local 3.8 run below the floor), it is ready to merge. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
|
Re-validation on head
Merge decision: held again. The PR changes test files, so the unverified 3.9 slot falls under the anchor-relevant scope gate and auto-merge is not taken. Merging is unblocked once #60 is resolved (pin the runner, drop 3.9, or pin only the 3.9 slot), or once a maintainer accepts the 3.8-local + 3.10–3.13 CI evidence as sufficient. This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
ubuntu-latest now resolves to Ubuntu 26.04, for which setup-python publishes no 3.9 build, so the 3.9 job failed before running anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Stage B (unit-test expansion) cycle: the behavior of the draw methods at zero and negative sizes was unpinned, and one piece of it was undocumented.
drawRectangle,drawImageanddrawButtonare pinned to draw no shape and raise nothing whenwidthorheightis0. Layout-derived sizes (an empty bar, a list with no rows) reach zero routinely.drawRectangleanddrawButtonare pinned to draw no shape: the extent is not mirrored back from(xpos, ypos)into a normal rectangle. A mutant that normalizes the rect was confirmed to fail 6 of these tests.drawImagenegative size raisesValueError(frompygame.transform.scale). That behavior was undocumented; it is now pinned by a test and added to thedrawImagedocstring'sRaises:section and the README.drawButtonat a degenerate size — pinned to have no clickable coordinate, including at its anchor and in the mirrored region. This is consistent with the documented "clickable region is exactly the drawn box". A non-empty label is still painted (only the box is skipped); this is pinned too, and the README wording says "draws no shape" rather than "draws nothing" for that reason.No production behavior was changed. The
graphik.pyedit is docstring-only.Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pypython3 -m pytest(headless viaconftest.py): 111 passed, 29 of them new. Run locally on Python 3.8.10 with pygame 2.1.2.drawRectangleto normalize negative rects fails 6 negative-size tests; restoring the original passes them all.actions/setup-pythonbefore any project code runs, becauseubuntu-latestnow resolves to Ubuntu 26.04, which has no 3.9 build. The last greenmainrun usedubuntu-24.04. This is environmental and is tracked in ci: the Python 3.9 test job fails at setup-python since ubuntu-latest moved to Ubuntu 26.04 #60.Backlog skip reasons
No tracking issue — gap found during triage. The four open issues were left untouched because each is human-gated:
.github/workflows/, which is excluded from autonomous change, and release: version tags are pushed without the 'v' prefix publish.yml requires, so no release has ever been published #34 also needs a maintainer decision on tag format.preponderous.*namespace convention across sibling projects.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