Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e161744

Browse filesBrowse 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 <info@bnoordhuis.nl> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
1 parent 16926a8 commit e161744
Copy full SHA for e161744

File tree

Expand file treeCollapse file tree

2 files changed

+27
-27
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+27
-27
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-crypto-dh.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-crypto-dh.js
+27Lines changed: 27 additions & 0 deletions
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+
);
Collapse file

‎test/pummel/test-crypto-dh.js‎

Copy file name to clipboardExpand all lines: test/pummel/test-crypto-dh.js
-27Lines changed: 0 additions & 27 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.