Repository navigation
all-your-base: document the input format and exception messages the tests require - #3183
Closed
Mike-7777777 wants to merge 1 commit into
Closed
Mike-7777777 wants to merge 1 commit into
Mike-7777777 wants to merge 1 commit into
Conversation
Member
|
I am rejecting this one. Exercism uses TDD. Students (not agents or LLMs) are should generally look in the tests to see what the expectations are. |
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.
Pull Request
Closes #3185
Three things the
all-your-basetests check are not stated anywhere in the exercise:BaseConverterTest.java:130-206) assertIllegalArgumentExceptionwith an exact message: "Bases must be at least 2." (six tests, for both bases), "Digits may not be negative." and "All digits must be strictly less than the base.".empty list(:90-97) expectsnew int[]{}to convert to[0].multiple zerosandleading zeros(:110-127) expect leading zeros to be accepted.instructions.mdonly explains positional notation, there is noinstructions.append.md, and the stub gives no hint about exception types or messages. Earlier versions of this exercise's tests required the opposite for the last two points (exceptions "You must supply at least one digit." and "Digits may not contain leading zeros."), so a student who remembers them fails three tests with no way to know why until the test file is opened.This PR adds
.docs/instructions.append.mdwith an "Input format" section and an "Exception messages" section, the latter in the same format as the Java track'spovexercise (and #3182 forwordy). Tests and the example solution are unchanged.How I checked it, against the current
all-your-basetests onmain(20 tests, all enabled):.meta/src/reference/java/BaseConverter.javainstructions.mdand the stub aloneempty list,multiple zerosandleading zeros, where it throws the old exceptions, plusnegative digitandinvalid positive digiton the message); the other passes 20/20 because it used these exact messages from memoryinstructions.mdplus the newinstructions.append.mdThe 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_polyglotadapter build their prompts from.docs/instructions*.md): in our evaluation runs, 42 of 60 attempts at this exercise failed. All 42 threwIllegalArgumentExceptionfor every invalid input; 25 failed only on the message wording, and the other 17 also rejected the empty array or leading zeros.Reviewer Resources:
Track Policies