Skip to content

✅ rewrite MoveTest against public API - #94

Merged
garak merged 1 commit into
p-chess:masterfrom
garak:move-test-public-api
Oct 15, 2026
Merged

garak merged 1 commit into
p-chess:masterfrom
garak:move-test-public-api

Conversation

@garak

@garak garak commented Oct 10, 2026

Copy link
Copy Markdown
Member
  • Use move()/undo() instead of publicator build/make/undo. Engine decides flags.
  • Add real en passant undo round-trip (h2-h4, gxh3). Old test never set the ep square.
  • Fix SAN ep FEN to include the ep square.
  • Assert a8=Q+ on promotion: a8-h1 diagonal checks the king.
  • Drop unused publicator helpers. Only getBoardHash and perft remain.

Part of #91 (step 3).

- Use move()/undo() instead of publicator build/make/undo. Engine decides flags.
- Add real en passant undo round-trip (h2-h4, gxh3). Old test never set the ep square.
- Fix SAN ep FEN to include the ep square.
- Assert a8=Q+ on promotion: a8-h1 diagonal checks the king.
- Drop unused publicator helpers. Only getBoardHash and perft remain.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The test refactor preserves coverage while validating realistic public-API behavior and removes only unused helpers.

0 open findings

What changed in this PR

Rewrites move tests around public APIs while improving en passant, promotion, SAN, and undo coverage.

Changes:

  • Replaced protected-method proxies with move(), undo(), and moves().
  • Added data-driven SAN and undo round-trip tests.
  • Removed unused ChessPublicator helpers.
File Description
tests/​MoveTest.php Exercises move behavior through public APIs.
tests/​ChessPublicator.php Removes obsolete protected-method wrappers.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@garak
garak merged commit 586747d into p-chess:master Oct 15, 2026
5 checks passed
@garak
garak deleted the move-test-public-api branch October 15, 2026 06:56
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.

2 participants