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: improve test for crypto pbkdf2 #9883

Closed
wants to merge 2 commits into from

Conversation

joyeecheung
Copy link
Member

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

test

Description of change
  • use assert.strictEqual instead of assert.equal
  • add regexp for assert.throws

- use assert.strictEqual instead of assert.equal
- add regexp for 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 crypto Issues and PRs related to the crypto subsystem. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. labels Dec 1, 2016
@Trott
Copy link
Member

Trott commented Dec 1, 2016

}

// Error path should not leak memory (check with valgrind).
assert.throws(function() {
crypto.pbkdf2('password', 'salt', 1, 20, null);
});
}, /No callback/);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can you please add the full error message and add ^ and $ at the beginning and end of the regex?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I have updated other error messages too

Test for full error message with `^` and `$`
Copy link
Member Author

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

Sure, I've updated other error messages too

}

// Error path should not leak memory (check with valgrind).
assert.throws(function() {
crypto.pbkdf2('password', 'salt', 1, 20, null);
});
}, /No callback/);
Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I have updated other error messages too

Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

LGTM! thank you for participating in code and learn! Welcome to Node.js!

@Trott
Copy link
Member

Trott commented Dec 3, 2016

CI failures are build failures and unrelated to this change.

Trott pushed a commit to Trott/io.js that referenced this pull request Dec 3, 2016
- use assert.strictEqual instead of assert.equal
- add regexp for assert.throws

PR-URL: nodejs#9883
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@Trott
Copy link
Member

Trott commented Dec 3, 2016

Landed in aeec621. Thanks for the contribution! 🎉

@Trott Trott closed this Dec 3, 2016
addaleax pushed a commit that referenced this pull request Dec 5, 2016
- use assert.strictEqual instead of assert.equal
- add regexp for assert.throws

PR-URL: #9883
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@Fishrock123 Fishrock123 mentioned this pull request Dec 5, 2016
2 tasks
addaleax pushed a commit to addaleax/node that referenced this pull request Dec 8, 2016
- use assert.strictEqual instead of assert.equal
- add regexp for assert.throws

PR-URL: nodejs#9883
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
jmdarling pushed a commit to jmdarling/node that referenced this pull request Dec 8, 2016
- use assert.strictEqual instead of assert.equal
- add regexp for assert.throws

PR-URL: nodejs#9883
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
- use assert.strictEqual instead of assert.equal
- add regexp for assert.throws

PR-URL: #9883
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[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
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. crypto Issues and PRs related to the crypto subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants