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

Fix windows segfault #6938

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions test/parallel/test-cli-eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const child = require('child_process');
const path = require('path');
const nodejs = '"' + process.execPath + '"';


// replace \ by / because windows uses backslashes in paths, but they're still
Copy link
Member

Choose a reason for hiding this comment

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

Could you undo the whitespace changes in the lines your changes don’t touch? That helps when running e.g. git blame on a file

// interpreted as the escape character when put between quotes.
var filename = __filename.replace(/\\/g, '/');
Expand Down Expand Up @@ -66,8 +65,14 @@ child.exec(nodejs + ' --eval "require(\'./test/parallel/test-cli-eval.js\')"',
assert.equal(status.code, 42);
});

// Missing argument should not crash
child.exec(nodejs + ' -e', function (status, stdout, stderr) {
assert.notStrictEqual(status, null);
assert.equal(status.code, 9);
Copy link
Member

Choose a reason for hiding this comment

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

nit: It’s generally preferred to use assert.strictEqual over assert.equal

Copy link
Contributor

Choose a reason for hiding this comment

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

Use strictEqual

});

// empty program should do nothing
child.exec(nodejs + ' -e ""', function(status, stdout, stderr) {
child.exec(nodejs + ' -e ""', function (status, stdout, stderr) {
assert.equal(stdout, '');
assert.equal(stderr, '');
});
Expand Down