-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
Multiline comments #228
Multiline comments #228
Conversation
Since there were no tests for t.comment(), which I'm going to modify, I want to make sure of what the current behaviour is, to ensure I don't change more than I need to.
We should probably split on |
@@ -102,7 +102,10 @@ Test.prototype.test = function (name, opts, cb) { | |||
}; | |||
|
|||
Test.prototype.comment = function (msg) { | |||
this.emit('result', trim(msg).replace(/^#\s*/, '')); | |||
var that = this; | |||
String(trim(msg)).split('\n').forEach(function (aMsg) { |
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.
No need to cast to string here. Trim helper should return a string.
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.
correct, it does
Really nice. Tests look good 👍 will merge after 24hr to let other reviewers leave comments |
@Raynos LGTM as well, pending #228 (comment) |
Thanks for the feedback! |
👍 Thanks for doing this! Just came across this issue as well |
t.comment([ | ||
'c', | ||
'd', | ||
].join('\r\n')); |
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.
won't this result in invisible \r
characters appearing in the output? it's likely that this is getting obscured in the test.
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.
They're actually being trim()
med in test.js:107
: removing the inner call to trim()
makes this part of the test fail.
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.
aha, ok that makes sense then :-) thanks for clarifying
This should address #196.
Knowing nothing of tap I probably added more test code than needed, but I wanted to try and make sure I don't break existing functionality.
All feedback is welcome!