test: improve assert message in test-dh-regr#15912
test: improve assert message in test-dh-regr#15912Epitrochoid wants to merge 1 commit intonodejs:masterfrom
Conversation
BridgeAR
left a comment
There was a problem hiding this comment.
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 <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in 42dfde8. Thank you! |
PR-URL: nodejs/node#15912 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #15912 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #15912 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #15912 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #15912 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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