Quick bug bag: six independent small fixes (#29, #30, #31, #32, #33, #36)#49
Open
dbqpdb wants to merge 6 commits into
Open
Quick bug bag: six independent small fixes (#29, #30, #31, #32, #33, #36)#49dbqpdb wants to merge 6 commits into
dbqpdb wants to merge 6 commits into
Conversation
The final clause compared self.new_en_passant_square to itself instead of to move_to_match.new_en_passant_square, so two Move objects that differed only in their generated en-passant square compared equal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The file contained only "import rlm.py" which is invalid Python (module names don't include the .py extension). It had no main guard and was unreferenced, so deleting rather than fixing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Exception(...) was constructed but never raised, so setting an invalid square name silently did nothing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
assert(cond, "msg") parses as a non-empty tuple, which is always truthy,
so the assertion passed regardless of the comparison. Rewrote as the
proper assert <cond>, <msg> form.
grep -nE 'assert\(' rlm.py found this as the only instance.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
setdefault mutates the dict when the key is missing, so any unrecognized file character (typo'd square name, None, etc.) was being permanently added to the class-level FILE_TO_IDX_DICT and persisting across every Board instance for the life of the process. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The function unconditionally dumped a multi-line dict to the terminal on every call, cluttering gameplay output every time a human entered a move. Added verbose=False kwarg; existing callers default to quiet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 14, 2026
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
Six independent small fixes from the bug bag, each in its own commit so they can be reviewed and reverted individually.
Move.__eq__comparedself.new_en_passant_squareto itself; now compares tomove_to_match.new_en_passant_square.runFromOutside.py(single lineimport rlm.pywas invalid Python, file was unreferenced).raiseinBoard.__setitem__so invalid square names actually error.assert(cond, "msg")inTestRLM.test_entered_move_processingto the properassert cond, "msg"form.grep -nE 'assert\(' rlm.pyfound only this one instance.Board.FILE_TO_IDX_DICT.setdefault(...)with.get(...)so unknown keys don't permanently mutate the class-level dict.Move.parse_move_without_gamebehind a newverbose=Falsekwarg; existing callers default to quiet.Test plan
TestRLM().run_all_tests()— all four tests pass.test_entered_move_processing— now runs the assertion that previously was always-truthy; passes.Known limitations / out of scope
test_entered_move_processingexercises only the pawn-promotion case fully; the rest of the file is a series ofentered_move = '...'strings with no follow-up assertions. That's tracked as part of the broader testing umbrella in Unit testing #23 and the pytest migration prerequisite for CI: run unit tests on pull requests targeting master #43.🤖 Generated with Claude Code