From d8f2d669b8d97d17a7e7ab42e125ad0b26a570da 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 ce4ced41b632e1..d6ddd2befbbdb8 100644 --- a/test/pummel/test-dh-regr.js +++ b/test/pummel/test-dh-regr.js @@ -15,9 +15,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')}` ); }