simple-cipher: Disallow mixed case key#491
Merged
matthewmorgan merged 1 commit intoexercism:masterfrom Oct 6, 2018
Merged
Conversation
A solution that checks if the key is valid (i.e. only contains alpha
ascii lower-case letters) by testing
if (key === key.toUpperCase()) { throw new Error('Bad key') }`
passes the current "throws an error with an all caps key" test
but allows mixed-case keys, which should actually be invalid.
Contributor
|
Thanks @tekerson ! I was wondering about this, and I see that the canonical test file for this exercise does not contain a test against mixed-case keys, but the README specifies that the key should be all lowercase:
We appreciate you adding this here, can I suggest that you add it to problem-specifications also? It would help all the tracks. |
Contributor
Author
|
Good point @matthewmorgan! |
Contributor
|
Awesome! Thanks for doing that. I'm not a maintainer on that track, but they tend to be pretty speedy about giving feedback. |
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.
This test has already been added to the TypeScript version of this exercise. The JavaScript example implementation already passes, but I still think the test is valuable as I've seen the same error in JavaScript student submissions.
A solution that checks if the key is valid (i.e. only contains alpha ascii lower-case letters) by testing
passes the current "throws an error with an all caps key" test but allows mixed-case keys, which should actually be invalid.