Skip to content
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

Merged
merged 5 commits into from Dec 31, 2015
Merged

Multiline comments #228

merged 5 commits into from Dec 31, 2015

Conversation

ghost
Copy link

@ghost ghost commented Dec 27, 2015

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!

Nicola Girardi added 3 commits December 27, 2015 14:07
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.
@ljharb
Copy link
Collaborator

ljharb commented Dec 27, 2015

We should probably split on [\r\n] or something similar, to handle Windows line endings as well.

@@ -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) {
Copy link
Collaborator

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct, it does

@Raynos
Copy link
Collaborator

Raynos commented Dec 27, 2015

Really nice. Tests look good

👍 will merge after 24hr to let other reviewers leave comments

@ljharb
Copy link
Collaborator

ljharb commented Dec 27, 2015

@Raynos LGTM as well, pending #228 (comment)

@ghost
Copy link
Author

ghost commented Dec 29, 2015

Thanks for the feedback!

@jackp
Copy link

jackp commented Dec 29, 2015

👍 Thanks for doing this! Just came across this issue as well

t.comment([
'c',
'd',
].join('\r\n'));
Copy link
Collaborator

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.

Copy link
Author

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.

Copy link
Collaborator

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

Raynos added a commit that referenced this pull request Dec 31, 2015
@Raynos Raynos merged commit cde93a2 into tape-testing:master Dec 31, 2015
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants