Skip to content

Test pygame showOptions selection paths#99

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/pygame-showoptions-tests
Jun 13, 2026
Merged

Test pygame showOptions selection paths#99
dmccoystephenson merged 1 commit into
mainfrom
feature/pygame-showoptions-tests

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Stage B test-expansion (final): showOptions — the pygame UI's primary menu loop — was the last interactive method with no coverage.

  • tests/ui/test_pygameUserInterface.py: a number key selects directly; arrow-down + Enter moves the highlight and confirms (["A","B","C"] → "2"); an out-of-range number key (9 with 2 options) is ignored until a valid one is pressed.

This completes the pygame front-end's interactive coverage (resize/font helpers + showOptions/showDialogue/promptForText/timedKeyPress). Characterization only; headless under dummy SDL.

Test plan

  • SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest — 221 passed (3 new)

🤖 Generated with Claude Code

showOptions is the pygame UI's primary menu loop and was the last interactive
method with no coverage. Its three input paths now have tests (events injected
via the patched pygame.event.get): a number key selects directly, arrow-down +
Enter moves the highlight and confirms it, and an out-of-range number key is
ignored until a valid choice is pressed.

With this, the pygame front-end's resize/font helpers and all four interactive
primitives (showOptions / showDialogue / promptForText / timedKeyPress) are
covered.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@dmccoystephenson dmccoystephenson left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review:

  • Scope: PASS — pygame test file only; characterization, no prod change.
  • Tests-new: PASS — number-key, arrow+Enter, and out-of-range-guard paths of showOptions were uncovered.
  • Headless-pygame: PASS — injected events; CI green (221). Completes pygame interactive coverage.

@dmccoystephenson dmccoystephenson merged commit dae2dd7 into main Jun 13, 2026
1 check passed
@dmccoystephenson dmccoystephenson deleted the feature/pygame-showoptions-tests branch June 13, 2026 20:43
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