Skip to content

Commit e161744

Browse files
Trotttargos
authored andcommitted
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: #28390 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
1 parent 16926a8 commit e161744

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

test/parallel/test-crypto-dh.js

+27
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,30 @@ common.expectsError(
388388
message: 'The "curve" argument must be of type string. ' +
389389
'Received type undefined'
390390
});
391+
392+
assert.throws(
393+
function() {
394+
crypto.getDiffieHellman('unknown-group');
395+
},
396+
/^Error: Unknown group$/,
397+
'crypto.getDiffieHellman(\'unknown-group\') ' +
398+
'failed to throw the expected error.'
399+
);
400+
assert.throws(
401+
function() {
402+
crypto.getDiffieHellman('modp1').setPrivateKey('');
403+
},
404+
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
405+
'setPrivateKey is not a function$'),
406+
'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
407+
'failed to throw the expected error.'
408+
);
409+
assert.throws(
410+
function() {
411+
crypto.getDiffieHellman('modp1').setPublicKey('');
412+
},
413+
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
414+
'setPublicKey is not a function$'),
415+
'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
416+
'failed to throw the expected error.'
417+
);

test/pummel/test-crypto-dh.js

-27
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,6 @@ if (!common.hasCrypto)
2727
const assert = require('assert');
2828
const crypto = require('crypto');
2929

30-
assert.throws(
31-
function() {
32-
crypto.getDiffieHellman('unknown-group');
33-
},
34-
/^Error: Unknown group$/,
35-
'crypto.getDiffieHellman(\'unknown-group\') ' +
36-
'failed to throw the expected error.'
37-
);
38-
assert.throws(
39-
function() {
40-
crypto.getDiffieHellman('modp1').setPrivateKey('');
41-
},
42-
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
43-
'setPrivateKey is not a function$'),
44-
'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
45-
'failed to throw the expected error.'
46-
);
47-
assert.throws(
48-
function() {
49-
crypto.getDiffieHellman('modp1').setPublicKey('');
50-
},
51-
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
52-
'setPublicKey is not a function$'),
53-
'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
54-
'failed to throw the expected error.'
55-
);
56-
5730
const hashes = {
5831
modp1: '630e9acd2cc63f7e80d8507624ba60ac0757201a',
5932
modp2: '18f7aa964484137f57bca64b21917a385b6a0b60',

0 commit comments

Comments
 (0)