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

test: fix buffer alloc tests #9998

Closed
wants to merge 1 commit into from

Conversation

levsoroka
Copy link
Contributor

@levsoroka levsoroka commented Dec 1, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

Replaced assert.equal to assert.strictEqual.
Fixed assert.throws syntax and added second argument to assert.throws

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 1, 2016
@imyller imyller added code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. buffer Issues and PRs related to the buffer subsystem. labels Dec 1, 2016
@gibfahn
Copy link
Member

gibfahn commented Dec 1, 2016

@@ -1027,7 +1027,8 @@ assert(Buffer.allocUnsafe(1).parent instanceof ArrayBuffer);
Buffer.poolSize = ps;

// Test Buffer.copy() segfault
assert.throws(() => Buffer.allocUnsafe(10).copy());
assert.throws(() => Buffer.allocUnsafe(10).copy(),
/TypeError: argument should be a Buffer/);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you line this up with the beginning of the arrow function on the previous line. Also, if you're validating the entire error message, you can add ^ and $ to the regular expression.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lined up with arrow function. I did not match for start of string and end of string since error message that I saw were lengthy and contained much more to the string thats in validation.

Replaced assert.equal to assert.strictEqual.
Fixed assert.throws syntax and added second argument
jasnell pushed a commit that referenced this pull request Dec 5, 2016
Replaced assert.equal to assert.strictEqual.
Fixed assert.throws syntax and added second argument

PR-URL: #9998
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Dec 5, 2016

Landed in ee97f84. thank you for the PR and for participating in the code-and-learn!

@jasnell jasnell closed this Dec 5, 2016
Fishrock123 pushed a commit that referenced this pull request Dec 6, 2016
Replaced assert.equal to assert.strictEqual.
Fixed assert.throws syntax and added second argument

PR-URL: #9998
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit to addaleax/node that referenced this pull request Dec 8, 2016
Replaced assert.equal to assert.strictEqual.
Fixed assert.throws syntax and added second argument

PR-URL: nodejs#9998
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
jmdarling pushed a commit to jmdarling/node that referenced this pull request Dec 8, 2016
Replaced assert.equal to assert.strictEqual.
Fixed assert.throws syntax and added second argument

PR-URL: nodejs#9998
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
Replaced assert.equal to assert.strictEqual.
Fixed assert.throws syntax and added second argument

PR-URL: #9998
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Dec 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants