Skip to content

Commit

Permalink
test: favor === over == in crypto tests
Browse files Browse the repository at this point in the history
PR-URL: #8176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
Trott authored and rvagg committed Oct 18, 2016
1 parent d0dcee2 commit 053f54a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-authenticated.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ var ciphers = crypto.getCiphers();
for (var i in TEST_CASES) {
var test = TEST_CASES[i];

if (ciphers.indexOf(test.algo) == -1) {
if (ciphers.indexOf(test.algo) === -1) {
common.skip('unsupported ' + test.algo + ' test');
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-hmac.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var wikipedia = [
for (let i = 0, l = wikipedia.length; i < l; i++) {
for (const hash in wikipedia[i]['hmac']) {
// FIPS does not support MD5.
if (common.hasFipsCrypto && hash == 'md5')
if (common.hasFipsCrypto && hash === 'md5')
continue;
const result = crypto.createHmac(hash, wikipedia[i]['key'])
.update(wikipedia[i]['data'])
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-crypto-dh.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for (const name in hashes) {

for (const name in hashes) {
// modp1 is 768 bits, FIPS requires >= 1024
if (name == 'modp1' && common.hasFipsCrypto)
if (name === 'modp1' && common.hasFipsCrypto)
continue;
var group1 = crypto.getDiffieHellman(name);
var group2 = crypto.getDiffieHellman(name);
Expand Down

0 comments on commit 053f54a

Please sign in to comment.