-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Conversation
- use assert.strictEqual instead of assert.equal - add regexp for assert.throws
} | ||
|
||
// Error path should not leak memory (check with valgrind). | ||
assert.throws(function() { | ||
crypto.pbkdf2('password', 'salt', 1, 20, null); | ||
}); | ||
}, /No callback/); |
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.
Nit: can you please add the full error message and add ^
and $
at the beginning and end of the regex?
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.
Sure, I have updated other error messages too
Test for full error message with `^` and `$`
fd96d6a
to
71ba2df
Compare
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.
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/); |
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.
Sure, I have updated other error messages too
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.
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.
LGTM! thank you for participating in code and learn! Welcome to Node.js!
CI failures are build failures and unrelated to this change. |
- use assert.strictEqual instead of assert.equal - add regexp for assert.throws PR-URL: nodejs#9883 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in aeec621. Thanks for the contribution! 🎉 |
- use assert.strictEqual instead of assert.equal - add regexp for assert.throws PR-URL: #9883 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
- use assert.strictEqual instead of assert.equal - add regexp for assert.throws PR-URL: nodejs#9883 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
- use assert.strictEqual instead of assert.equal - add regexp for assert.throws PR-URL: nodejs#9883 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
- use assert.strictEqual instead of assert.equal - add regexp for assert.throws PR-URL: #9883 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change