-
Notifications
You must be signed in to change notification settings - Fork 0
Tues exercism #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: exorcism
Are you sure you want to change the base?
Conversation
| var Bob = function() {}; | ||
|
|
||
| Bob.prototype.hey = function(what) { | ||
| if (/([A-Z]+\s){2,}|[A-Z](?=!)/.test(what)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of RegExp, especially the lookahead 👍
| var result = bob.hey('\xdcML\xc4\xdcTS!'); | ||
|
|
||
| var result = bob.hey('\xdcML\xc4\xdcTS!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious what the intention of this test and the special characters test above it are. Both of those tests have ordinary capitalized letters followed by exclamation marks, which should match the RegExp regardless of whether the special characters match.
I know you didn't write it, I'm just not sure that it's testing anything different than the other cases and wanted to point that out. 😋
| var SecretHandshake = function(input) { | ||
| if (typeof input !== 'number') { | ||
| throw new Error('Handshake must be a number') | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| var bracket = function(input) { | ||
| //define what ending bracket should be if the beginning is found | ||
| }; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should try to keep incomplete placeholders like this out of commits for complete tests, that way you have more freedom to cherry pick commits later or reorder them during a rebase without ending up with files getting reverted to a broken state.
Personally I try to make a separate commit for each change (ex: secret handshake would be a different commit from bob, and bob's commit would never have changes to secret handshake's files) but that's just one way of keeping git stuff organized.
No description provided.