Skip to content

wordy: document the exception message the tests require - #3182

Closed
Mike-7777777 wants to merge 1 commit into
exercism:mainfrom
Mike-7777777:wordy-document-exception-message
Closed

Mike-7777777 wants to merge 1 commit into
exercism:mainfrom
Mike-7777777:wordy-document-exception-message

Conversation

@Mike-7777777

@Mike-7777777 Mike-7777777 commented Nov 22, 2026 •

Copy link
Copy Markdown

Pull Request

Closes #3184

The eight error tests in WordProblemSolverTest (unknown operation, non-math question, missing operand, no operands, two operations in a row, two numbers after an operation, postfix and prefix notation) all expect

.withMessage("I'm sorry, I don't understand the question!")

but nothing in the exercise says so. instructions.md only says the parser "should reject" these inputs, and the stub gives no hint about the exception type or message. A student who throws IllegalArgumentException("unknown operation"), for example, fails all eight tests with no way to know why until the test file is opened.

This PR adds .docs/instructions.append.md with an "Exception messages" section, written in the same format as the Java track's pov exercise, stating the exception type and the exact message. The Python track's wordy documents its messages the same way. Tests and the example solution are unchanged.

How I checked it, against the current wordy tests on main (27 tests, all enabled):

Solution Result
.meta/src/reference/java/WordProblemSolver.java 27/27 pass
Two solutions written from instructions.md and the stub alone 8 and 7 of 27 fail; every failure is "Expecting message to be: I'm sorry, I don't understand the question!" (the second one happened to use that message for the non-math case)
Two solutions written from instructions.md plus the new instructions.append.md 27/27 pass

The four solutions were written by separate model runs that saw only the docs and the stub, never the tests.

markdownlint-cli2 (the repository's .markdownlint-cli2.jsonc) reports 0 errors.

The same gap shows up when the exercise is used as a hidden-test benchmark (the Aider polyglot benchmark and the Harbor aider_polyglot adapter build their prompts from .docs/instructions*.md): in our evaluation runs, 39 of the 41 failing attempts at this exercise failed only on these eight message assertions.


Reviewer Resources:

Track Policies

@kahgoh

kahgoh commented Nov 23, 2026

Copy link
Copy Markdown
Member

Similar to the all-your-base PR, this is not needed.

@kahgoh kahgoh closed this Nov 23, 2026
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.

wordy: the exception message the tests require is not documented

2 participants