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 <info@bnoordhuis.nl> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit is contained in:
parent
c42da5ed29
commit
0f82704c36
@ -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.'
|
||||
);
|
||||
|
@ -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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user