Skip to content

Add test for partially numeric spin option - #7008

Open
jdeguzman11 wants to merge 1 commit into
official-stockfish:masterfrom
jdeguzman11:cleanup-candidate
Open

Add test for partially numeric spin option#7008
jdeguzman11 wants to merge 1 commit into
official-stockfish:masterfrom
jdeguzman11:cleanup-candidate

Conversation

@jdeguzman11

Copy link
Copy Markdown

Adds regression coverage for partially numeric spin option values such as 12abc.

The existing invalid option tests cover non-numeric, negative, and out-of-range values, but not values that begin with valid digits and contain trailing non-numeric characters.

Validation:

  • python3 -m py_compile tests/instrumented.py
  • python3 tests/instrumented.py src/stockfish
  • 74 tests passed, 0 failed

No functional change.

@vondele

vondele commented Jul 27, 2026

Copy link
Copy Markdown
Member

I'm not so sure we want to test this works. This is largely undefined behavior / invalid input?

@jdeguzman11

Copy link
Copy Markdown
Author

I'm not so sure we want to test this works. This is largely undefined behavior / invalid input?

That makes sense. My thought was to add regression coverage for the stricter numeric parsing added recently, specifically to ensure partially numeric values like 12abc continue to be rejected rather than partially parsed. But I agree that if malformed setoption input is considered outside the behavior Stockfish intends to guarantee, then this test may be too specific. Happy to drop or adjust it if there’s a more appropriate edge case to cover.

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