Browse Source

test: clarify assert messages in crypto tests

PR-URL: https://github.com/nodejs/node/pull/16019
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Lance Ball <lball@redhat.com>
v6.x-staging
cpandrews8 7 years ago
committed by Myles Borins
parent
commit
3e5e8cbfcf
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 4
      test/parallel/test-crypto-sign-verify.js

4
test/parallel/test-crypto-sign-verify.js

@ -27,7 +27,7 @@ const modSize = 1024;
let s1stream = crypto.createSign('SHA1'); let s1stream = crypto.createSign('SHA1');
s1stream.end('Test123'); s1stream.end('Test123');
s1stream = s1stream.sign(keyPem, 'base64'); s1stream = s1stream.sign(keyPem, 'base64');
assert.strictEqual(s1, s1stream, 'Stream produces same output'); assert.strictEqual(s1, s1stream, `${s1} should equal ${s1stream}`);
const verified = crypto.createVerify('SHA1') const verified = crypto.createVerify('SHA1')
.update('Test') .update('Test')
@ -43,7 +43,7 @@ const modSize = 1024;
let s2stream = crypto.createSign('SHA256'); let s2stream = crypto.createSign('SHA256');
s2stream.end('Test123'); s2stream.end('Test123');
s2stream = s2stream.sign(keyPem, 'latin1'); s2stream = s2stream.sign(keyPem, 'latin1');
assert.strictEqual(s2, s2stream, 'Stream produces same output'); assert.strictEqual(s2, s2stream, `${s2} should equal ${s2stream}`);
let verified = crypto.createVerify('SHA256') let verified = crypto.createVerify('SHA256')
.update('Test') .update('Test')

Loading…
Cancel
Save