From 42dfde827b39f4298ee8491dedf588d103662dc9 Mon Sep 17 00:00:00 2001 From: Mabry Cervin Date: Fri, 6 Oct 2017 10:07:17 -0700 Subject: [PATCH] test: improve assert message in test-dh-regr PR-URL: https://github.com/nodejs/node/pull/15912 Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/pummel/test-dh-regr.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/pummel/test-dh-regr.js b/test/pummel/test-dh-regr.js index b8e0ca3f1f88cc..ff964ec13a47c6 100644 --- a/test/pummel/test-dh-regr.js +++ b/test/pummel/test-dh-regr.js @@ -36,9 +36,14 @@ for (let i = 0; i < 2000; i++) { a.generateKeys(); b.generateKeys(); + const aSecret = a.computeSecret(b.getPublicKey()); + const bSecret = b.computeSecret(a.getPublicKey()); + assert.deepStrictEqual( - a.computeSecret(b.getPublicKey()), - b.computeSecret(a.getPublicKey()), - 'secrets should be equal!' + aSecret, + bSecret, + 'Secrets should be equal.\n' + + `aSecret: ${aSecret.toString('base64')}\n` + + `bSecret: ${bSecret.toString('base64')}` ); }