-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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 assert message in test-dh-regr #15912
Conversation
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
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.
This actually changes the test somewhat since it is not clear from the test if the same code path are still hit or not. That is probably the case but I would still prefer not to use base64
when calling computeSecret
. The return value is a buffer and that could be changed to base64 when printing, instead of changing the arguments.
Agree with @BridgeAR that it would be preferable to not change the test, and that base64
can happen inside the template literal. Not a blocking objection for me, though.
015035c
to
2249287
Compare
This looks good, but it results in a lint error. (Run 'Secrets should be equal.\n' +
`aSecret: ${aSecret.toString('base64')}\n` +
`bSecret: ${bSecret.toString('base64')}` |
2249287
to
97dfdb3
Compare
Good catch, thanks. Fixed the long line, but I wasn't sure if it would be better to have |
PR-URL: #15912 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 42dfde8. Thank you! |
PR-URL: nodejs/node#15912 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #15912 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #15912 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #15912 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #15912 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
Part of the Node Interactive Code and Learn.
My task suggested improving the assert message in test-dh-regr as it currently doesn't print the failing values. To make the output readable I specified 'base64' as the encoding and print the secrets on test failure.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test