Skip to content

Commit 888be77

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
test: pummel test fixes
This fixes some variable redeclarations in pummel tests and, in the process, gets `test-stream-pipe-multi.js` to run again. It had been failing to run. PR-URL: #4998 Reviewed-By: Brian White <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 6a0fad2 commit 888be77

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

test/pummel/test-crypto-dh.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var hashes = {
3030
modp18 : 'a870b491bbbec9b131ae9878d07449d32e54f160'
3131
};
3232

33-
for (var name in hashes) {
33+
for (const name in hashes) {
3434
var group = crypto.getDiffieHellman(name);
3535
var private_key = group.getPrime('hex');
3636
var hash1 = hashes[name];
@@ -40,7 +40,7 @@ for (var name in hashes) {
4040
assert.equal(group.getGenerator('hex'), '02');
4141
}
4242

43-
for (var name in hashes) {
43+
for (const name in hashes) {
4444
// modp1 is 768 bits, FIPS requires >= 1024
4545
if (name == 'modp1' && common.hasFipsCrypto)
4646
continue;

test/pummel/test-exec.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ var common = require('../common');
33
var assert = require('assert');
44
var exec = require('child_process').exec;
55

6+
var SLEEP3_COMMAND;
67
if (!common.isWindows) {
78
// Unix.
8-
var SLEEP3_COMMAND = 'sleep 3';
9+
SLEEP3_COMMAND = 'sleep 3';
910
} else {
1011
// Windows: `choice` is a command built into cmd.exe. Use another cmd process
1112
// to create a process tree, so we can catch bugs related to it.
12-
var SLEEP3_COMMAND = 'cmd /c choice /t 3 /c X /d X';
13+
SLEEP3_COMMAND = 'cmd /c choice /t 3 /c X /d X';
1314
}
1415

1516

test/pummel/test-stream-pipe-multi.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ process.on('exit', function() {
4949
assert.equal(cnt, rclosed, 'readable streams closed');
5050
});
5151

52-
for (var i = 0; i < chunkSize; i++) {
53-
chunkSize[i] = i % 256;
52+
for (let i = 0; i < chunkSize; i++) {
53+
data[i] = i;
5454
}
5555

56-
for (var i = 0; i < cnt; i++) {
56+
for (let i = 0; i < cnt; i++) {
5757
var r = new FakeStream();
5858
r.on('close', function() {
5959
console.error(this.ID, 'read close');

0 commit comments

Comments
 (0)