From e16174461002d9b28729bed5cdb47c582ae9d800 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 22 Jun 2019 14:06:11 -0600 Subject: [PATCH] test: move non-pummel crypto DH tests to parallel Some parts of pummel/test-crypto-dh.js will be just fine in parallel/test-crypto-dh.js. Move them there. PR-URL: https://github.com/nodejs/node/pull/28390 Reviewed-By: Ben Noordhuis Reviewed-By: Daniel Bevenius --- test/parallel/test-crypto-dh.js | 27 +++++++++++++++++++++++++++ test/pummel/test-crypto-dh.js | 27 --------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js index 69d18f458e60bd..1fc8564ca16fcd 100644 --- a/test/parallel/test-crypto-dh.js +++ b/test/parallel/test-crypto-dh.js @@ -388,3 +388,30 @@ common.expectsError( message: 'The "curve" argument must be of type string. ' + 'Received type undefined' }); + +assert.throws( + function() { + crypto.getDiffieHellman('unknown-group'); + }, + /^Error: Unknown group$/, + 'crypto.getDiffieHellman(\'unknown-group\') ' + + 'failed to throw the expected error.' +); +assert.throws( + function() { + crypto.getDiffieHellman('modp1').setPrivateKey(''); + }, + new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' + + 'setPrivateKey is not a function$'), + 'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' + + 'failed to throw the expected error.' +); +assert.throws( + function() { + crypto.getDiffieHellman('modp1').setPublicKey(''); + }, + new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' + + 'setPublicKey is not a function$'), + 'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' + + 'failed to throw the expected error.' +); diff --git a/test/pummel/test-crypto-dh.js b/test/pummel/test-crypto-dh.js index f64f982c0e1100..a88e105a8aa0b7 100644 --- a/test/pummel/test-crypto-dh.js +++ b/test/pummel/test-crypto-dh.js @@ -27,33 +27,6 @@ if (!common.hasCrypto) const assert = require('assert'); const crypto = require('crypto'); -assert.throws( - function() { - crypto.getDiffieHellman('unknown-group'); - }, - /^Error: Unknown group$/, - 'crypto.getDiffieHellman(\'unknown-group\') ' + - 'failed to throw the expected error.' -); -assert.throws( - function() { - crypto.getDiffieHellman('modp1').setPrivateKey(''); - }, - new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' + - 'setPrivateKey is not a function$'), - 'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' + - 'failed to throw the expected error.' -); -assert.throws( - function() { - crypto.getDiffieHellman('modp1').setPublicKey(''); - }, - new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' + - 'setPublicKey is not a function$'), - 'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' + - 'failed to throw the expected error.' -); - const hashes = { modp1: '630e9acd2cc63f7e80d8507624ba60ac0757201a', modp2: '18f7aa964484137f57bca64b21917a385b6a0b60',