From 30d84f61fe4324b647aaf913763b2fb76468e63d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 18 Aug 2016 16:15:39 -0700 Subject: [PATCH] test: favor `===` over `==` in crypto tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/8176 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso --- test/parallel/test-crypto-authenticated.js | 2 +- test/parallel/test-crypto-hmac.js | 2 +- test/pummel/test-crypto-dh.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js index db0de9e2338a07..b816d8ada3db9c 100644 --- a/test/parallel/test-crypto-authenticated.js +++ b/test/parallel/test-crypto-authenticated.js @@ -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; } diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js index cc92e048524cf1..8b133c0f459674 100644 --- a/test/parallel/test-crypto-hmac.js +++ b/test/parallel/test-crypto-hmac.js @@ -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']) diff --git a/test/pummel/test-crypto-dh.js b/test/pummel/test-crypto-dh.js index 302b645bdd52f2..268496380f4c3a 100644 --- a/test/pummel/test-crypto-dh.js +++ b/test/pummel/test-crypto-dh.js @@ -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);