Skip to content
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: replace assert messages with template strings #15996

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test-crypto-hash.js
  • Loading branch information
nhoel authored and Trott committed Oct 27, 2017
commit 22f9e2fd22045a52d07b9bdbd94865f6a5ef3dd0
12 changes: 8 additions & 4 deletions test/parallel/test-crypto-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ if (!common.hasFipsCrypto) {
`${cryptoType} with ${digest} digest failed to evaluate to expected hash value.`
);
}
cryptoType = 'md5'; digest = 'hex';
cryptoType = 'md5';
digest = 'hex';
assert.strictEqual(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2',
`${cryptoType} with ${digest} digest failed to evaluate to expected hash value.`);
cryptoType = 'sha256';digest = 'base64';
cryptoType = 'sha256';
digest = 'base64';
assert.strictEqual(a2, '2bX1jws4GYKTlxhloUB09Z66PoJZW+y+hq5R8dnx9l4=',
`${cryptoType} with ${digest} digest failed to evaluate to expected hash value.`);
cryptoType = 'sha512'; digest = 'latin1';
cryptoType = 'sha512';
digest = 'latin1';
assert.deepStrictEqual(
a3,
Buffer.from(
Expand All @@ -66,7 +69,8 @@ assert.deepStrictEqual(
'\u00c2\u0006\u00da0\u00a1\u00879(G\u00ed\'',
'latin1'),
`${cryptoType} with ${digest} digest failed to evaluate to expected hash value.`);
cryptoType = 'sha1'; digest = 'hex';
cryptoType = 'sha1';
digest = 'hex';
assert.deepStrictEqual(
a4,
Buffer.from('8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'hex'),
Expand Down