simple-cipher: Add test to disallow mixed case key#219
Merged
masters3d merged 1 commit intoexercism:masterfrom Sep 17, 2018
Merged
simple-cipher: Add test to disallow mixed case key#219masters3d merged 1 commit intoexercism:masterfrom
masters3d merged 1 commit intoexercism:masterfrom
Conversation
Contributor
Author
|
It looks like the example implementation fails this test 😮 (I actually didn't even know there was an example implementation… oops). Is my assumption that the key should only contain lower case characters incorrect, or should I add a fix to the example implementation too? |
Contributor
|
Yes please. |
A solution that checks if the key is valid (i.e. only contains alpha ascii lower-case letters) by testing that `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
Author
|
I've updated the example implementation. But, it looks like CI broke for unrelated reasons;
I'm not sure if I can do anything about that, or if someone just needs to rerun the job? |
Contributor
|
Thanks! |
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.
Hi,
During mentoring, I came across a solution that checks if the key is valid (i.e. only contains alpha ascii lower-case letters) by testing
This passes the current "throws an error with an all caps key" test but allows mixed-case keys, which I believe should actually be invalid. So, I'm proposing a new test to test for this situation.