Browse Source

test: remove unused vars

Remove unused vars in tests

PR-URL: https://github.com/nodejs/node/pull/4536
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v4.x
Rich Trott 9 years ago
committed by Myles Borins
parent
commit
2f4538ddda
  1. 2
      test/addons/repl-domain-abort/test.js
  2. 9
      test/debugger/test-debugger-pid.js
  3. 2
      test/debugger/test-debugger-remote.js
  4. 5
      test/internet/test-dns.js
  5. 2
      test/parallel/test-domain-exit-dispose-again.js
  6. 1
      test/parallel/test-domain-implicit-fs.js
  7. 6
      test/parallel/test-vm-create-context-arg.js
  8. 4
      test/parallel/test-vm-harmony-proxies.js
  9. 4
      test/parallel/test-vm-harmony-symbols.js
  10. 3
      test/parallel/test-vm-new-script-new-context.js
  11. 2
      test/parallel/test-vm-run-in-new-context.js
  12. 2
      test/parallel/test-vm-static-this.js
  13. 1
      test/pummel/test-dtrace-jsstack.js
  14. 1
      test/pummel/test-fs-watch-file.js
  15. 3
      test/pummel/test-https-no-reader.js
  16. 4
      test/pummel/test-regress-GH-892.js
  17. 2
      test/pummel/test-stream2-basic.js
  18. 6
      test/pummel/test-timers.js
  19. 1
      test/pummel/test-watch-file.js
  20. 1
      test/sequential/test-pump-file2tcp.js
  21. 2
      test/sequential/test-stream2-fs.js
  22. 2
      test/sequential/test-tcp-wrap-listen.js
  23. 2
      test/timers/test-timers-reliability.js

2
test/addons/repl-domain-abort/test.js

@ -46,4 +46,4 @@ var options = {
}; };
// Run commands from fake REPL. // Run commands from fake REPL.
var dummy = repl.start(options); repl.start(options);

9
test/debugger/test-debugger-pid.js

@ -1,16 +1,9 @@
'use strict'; 'use strict';
var common = require('../common'); require('../common');
var assert = require('assert'); var assert = require('assert');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
var port = common.PORT + 1337;
var buffer = ''; var buffer = '';
var expected = [];
var scriptToDebug = common.fixturesDir + '/empty.js';
function fail() {
assert(0); // `--debug-brk script.js` should not quit
}
// connect to debug agent // connect to debug agent
var interfacer = spawn(process.execPath, ['debug', '-p', '655555']); var interfacer = spawn(process.execPath, ['debug', '-p', '655555']);

2
test/debugger/test-debugger-remote.js

@ -3,9 +3,7 @@ var common = require('../common');
var assert = require('assert'); var assert = require('assert');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
var port = common.PORT + 1337;
var buffer = ''; var buffer = '';
var expected = [];
var scriptToDebug = common.fixturesDir + '/empty.js'; var scriptToDebug = common.fixturesDir + '/empty.js';
function fail() { function fail() {

5
test/internet/test-dns.js

@ -3,7 +3,6 @@ require('../common');
var assert = require('assert'), var assert = require('assert'),
dns = require('dns'), dns = require('dns'),
net = require('net'), net = require('net'),
isIP = net.isIP,
isIPv4 = net.isIPv4, isIPv4 = net.isIPv4,
isIPv6 = net.isIPv6; isIPv6 = net.isIPv6;
var util = require('util'); var util = require('util');
@ -48,7 +47,7 @@ TEST(function test_reverse_bogus(done) {
var error; var error;
try { try {
var req = dns.reverse('bogus ip', function() { dns.reverse('bogus ip', function() {
assert.ok(false); assert.ok(false);
}); });
} catch (e) { } catch (e) {
@ -369,7 +368,7 @@ console.log('looking up nodejs.org...');
var cares = process.binding('cares_wrap'); var cares = process.binding('cares_wrap');
var req = new cares.GetAddrInfoReqWrap(); var req = new cares.GetAddrInfoReqWrap();
var err = cares.getaddrinfo(req, 'nodejs.org', 4); cares.getaddrinfo(req, 'nodejs.org', 4);
req.oncomplete = function(err, domains) { req.oncomplete = function(err, domains) {
assert.strictEqual(err, 0); assert.strictEqual(err, 0);

2
test/parallel/test-domain-exit-dispose-again.js

@ -5,7 +5,7 @@
// to that domain, including those whose callbacks are called from within // to that domain, including those whose callbacks are called from within
// the same invocation of listOnTimeout, _are_ called. // the same invocation of listOnTimeout, _are_ called.
var common = require('../common'); require('../common');
var assert = require('assert'); var assert = require('assert');
var domain = require('domain'); var domain = require('domain');
var disposalFailed = false; var disposalFailed = false;

1
test/parallel/test-domain-implicit-fs.js

@ -4,7 +4,6 @@
require('../common'); require('../common');
var assert = require('assert'); var assert = require('assert');
var domain = require('domain'); var domain = require('domain');
var events = require('events');
var caught = 0; var caught = 0;
var expectCaught = 1; var expectCaught = 1;

6
test/parallel/test-vm-create-context-arg.js

@ -4,12 +4,12 @@ var assert = require('assert');
var vm = require('vm'); var vm = require('vm');
assert.throws(function() { assert.throws(function() {
var ctx = vm.createContext('string is not supported'); vm.createContext('string is not supported');
}, TypeError); }, TypeError);
assert.doesNotThrow(function() { assert.doesNotThrow(function() {
var ctx = vm.createContext({ a: 1 }); vm.createContext({ a: 1 });
ctx = vm.createContext([0, 1, 2, 3]); vm.createContext([0, 1, 2, 3]);
}); });
assert.doesNotThrow(function() { assert.doesNotThrow(function() {

4
test/parallel/test-vm-harmony-proxies.js

@ -8,12 +8,12 @@ var vm = require('vm');
// src/node_contextify.cc filters out the Proxy object from the parent // src/node_contextify.cc filters out the Proxy object from the parent
// context. Make sure that the new context has a Proxy object of its own. // context. Make sure that the new context has a Proxy object of its own.
var sandbox = {}; var sandbox = {};
var result = vm.runInNewContext('this.Proxy = Proxy', sandbox); vm.runInNewContext('this.Proxy = Proxy', sandbox);
assert(typeof sandbox.Proxy === 'object'); assert(typeof sandbox.Proxy === 'object');
assert(sandbox.Proxy !== Proxy); assert(sandbox.Proxy !== Proxy);
// Unless we copy the Proxy object explicitly, of course. // Unless we copy the Proxy object explicitly, of course.
var sandbox = { Proxy: Proxy }; var sandbox = { Proxy: Proxy };
var result = vm.runInNewContext('this.Proxy = Proxy', sandbox); vm.runInNewContext('this.Proxy = Proxy', sandbox);
assert(typeof sandbox.Proxy === 'object'); assert(typeof sandbox.Proxy === 'object');
assert(sandbox.Proxy === Proxy); assert(sandbox.Proxy === Proxy);

4
test/parallel/test-vm-harmony-symbols.js

@ -5,12 +5,12 @@ var vm = require('vm');
// The sandbox should have its own Symbol constructor. // The sandbox should have its own Symbol constructor.
var sandbox = {}; var sandbox = {};
var result = vm.runInNewContext('this.Symbol = Symbol', sandbox); vm.runInNewContext('this.Symbol = Symbol', sandbox);
assert(typeof sandbox.Symbol === 'function'); assert(typeof sandbox.Symbol === 'function');
assert(sandbox.Symbol !== Symbol); assert(sandbox.Symbol !== Symbol);
// Unless we copy the Symbol constructor explicitly, of course. // Unless we copy the Symbol constructor explicitly, of course.
var sandbox = { Symbol: Symbol }; var sandbox = { Symbol: Symbol };
var result = vm.runInNewContext('this.Symbol = Symbol', sandbox); vm.runInNewContext('this.Symbol = Symbol', sandbox);
assert(typeof sandbox.Symbol === 'function'); assert(typeof sandbox.Symbol === 'function');
assert(sandbox.Symbol === Symbol); assert(sandbox.Symbol === Symbol);

3
test/parallel/test-vm-new-script-new-context.js

@ -21,7 +21,6 @@ assert.throws(function() {
console.error('undefined reference'); console.error('undefined reference');
var error;
script = new Script('foo.bar = 5;'); script = new Script('foo.bar = 5;');
assert.throws(function() { assert.throws(function() {
script.runInNewContext(); script.runInNewContext();
@ -41,7 +40,9 @@ code = 'foo = 1;' +
foo = 2; foo = 2;
obj = { foo: 0, baz: 3 }; obj = { foo: 0, baz: 3 };
script = new Script(code); script = new Script(code);
/* eslint-disable no-unused-vars */
var baz = script.runInNewContext(obj); var baz = script.runInNewContext(obj);
/* eslint-enable no-unused-vars */
assert.equal(1, obj.foo); assert.equal(1, obj.foo);
assert.equal(2, obj.bar); assert.equal(2, obj.bar);
assert.equal(2, foo); assert.equal(2, foo);

2
test/parallel/test-vm-run-in-new-context.js

@ -29,7 +29,9 @@ code = 'foo = 1;' +
'if (baz !== 3) throw new Error(\'test fail\');'; 'if (baz !== 3) throw new Error(\'test fail\');';
foo = 2; foo = 2;
obj = { foo: 0, baz: 3 }; obj = { foo: 0, baz: 3 };
/* eslint-disable no-unused-vars */
var baz = vm.runInNewContext(code, obj); var baz = vm.runInNewContext(code, obj);
/* eslint-enable no-unused-vars */
assert.equal(1, obj.foo); assert.equal(1, obj.foo);
assert.equal(2, obj.bar); assert.equal(2, obj.bar);
assert.equal(2, foo); assert.equal(2, foo);

2
test/parallel/test-vm-static-this.js

@ -25,7 +25,9 @@ code = 'foo = 1;' +
'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');'; 'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');';
foo = 2; foo = 2;
obj = { foo: 0, baz: 3 }; obj = { foo: 0, baz: 3 };
/* eslint-disable no-unused-vars */
var baz = vm.runInThisContext(code); var baz = vm.runInThisContext(code);
/* eslint-enable no-unused-vars */
assert.equal(0, obj.foo); assert.equal(0, obj.foo);
assert.equal(2, bar); assert.equal(2, bar);
assert.equal(1, foo); assert.equal(1, foo);

1
test/pummel/test-dtrace-jsstack.js

@ -32,7 +32,6 @@ var doogle = function() {
}; };
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
var prefix = '/var/tmp/node';
/* /*
* We're going to use DTrace to stop us, gcore us, and set us running again * We're going to use DTrace to stop us, gcore us, and set us running again

1
test/pummel/test-fs-watch-file.js

@ -9,7 +9,6 @@ var watchSeenTwo = 0;
var watchSeenThree = 0; var watchSeenThree = 0;
var watchSeenFour = 0; var watchSeenFour = 0;
var startDir = process.cwd();
var testDir = common.tmpDir; var testDir = common.tmpDir;
var filenameOne = 'watch.txt'; var filenameOne = 'watch.txt';

3
test/pummel/test-https-no-reader.js

@ -18,8 +18,6 @@ var options = {
}; };
var buf = new Buffer(1024 * 1024); var buf = new Buffer(1024 * 1024);
var sent = 0;
var received = 0;
var server = https.createServer(options, function(req, res) { var server = https.createServer(options, function(req, res) {
res.writeHead(200); res.writeHead(200);
@ -30,7 +28,6 @@ var server = https.createServer(options, function(req, res) {
}); });
server.listen(common.PORT, function() { server.listen(common.PORT, function() {
var resumed = false;
var req = https.request({ var req = https.request({
method: 'POST', method: 'POST',
port: common.PORT, port: common.PORT,

4
test/pummel/test-regress-GH-892.js

@ -17,11 +17,7 @@ var https = require('https');
var fs = require('fs'); var fs = require('fs');
var PORT = 8000;
var bytesExpected = 1024 * 1024 * 32; var bytesExpected = 1024 * 1024 * 32;
var gotResponse = false;
var started = false; var started = false;

2
test/pummel/test-stream2-basic.js

@ -157,7 +157,6 @@ test('pipe', function(t) {
'xxxxx' ]; 'xxxxx' ];
var w = new TestWriter(); var w = new TestWriter();
var flush = true;
w.on('end', function(received) { w.on('end', function(received) {
t.same(received, expect); t.same(received, expect);
@ -439,7 +438,6 @@ test('adding readable triggers data flow', function(t) {
r.push(new Buffer('asdf')); r.push(new Buffer('asdf'));
}; };
var called = false;
r.on('readable', function() { r.on('readable', function() {
onReadable = true; onReadable = true;
r.read(); r.read();

6
test/pummel/test-timers.js

@ -91,12 +91,12 @@ function t() {
expectedTimeouts--; expectedTimeouts--;
} }
var w = setTimeout(t, 200); setTimeout(t, 200);
var x = setTimeout(t, 200); setTimeout(t, 200);
var y = setTimeout(t, 200); var y = setTimeout(t, 200);
clearTimeout(y); clearTimeout(y);
var z = setTimeout(t, 200); setTimeout(t, 200);
clearTimeout(y); clearTimeout(y);

1
test/pummel/test-watch-file.js

@ -6,7 +6,6 @@ var fs = require('fs');
var path = require('path'); var path = require('path');
var f = path.join(common.fixturesDir, 'x.txt'); var f = path.join(common.fixturesDir, 'x.txt');
var f2 = path.join(common.fixturesDir, 'x2.txt');
console.log('watching for changes of ' + f); console.log('watching for changes of ' + f);

1
test/sequential/test-pump-file2tcp.js

@ -28,7 +28,6 @@ server.listen(common.PORT, function() {
}); });
var buffer = ''; var buffer = '';
var count = 0;
server.on('listening', function() { server.on('listening', function() {
}); });

2
test/sequential/test-stream2-fs.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
var common = require('../common'); var common = require('../common');
var R = require('_stream_readable');
var assert = require('assert'); var assert = require('assert');
var fs = require('fs'); var fs = require('fs');
@ -41,7 +40,6 @@ var w = new TestWriter();
w.on('results', function(res) { w.on('results', function(res) {
console.error(res, w.length); console.error(res, w.length);
assert.equal(w.length, size); assert.equal(w.length, size);
var l = 0;
assert.deepEqual(res.map(function(c) { assert.deepEqual(res.map(function(c) {
return c.length; return c.length;
}), expectLengths); }), expectLengths);

2
test/sequential/test-tcp-wrap-listen.js

@ -12,7 +12,7 @@ assert.equal(0, r);
server.listen(128); server.listen(128);
var slice, sliceCount = 0, eofCount = 0; var sliceCount = 0, eofCount = 0;
var writeCount = 0; var writeCount = 0;
var recvCount = 0; var recvCount = 0;

2
test/timers/test-timers-reliability.js

@ -44,7 +44,7 @@ monoTimer.ontimeout = function() {
monoTimer.start(300, 0); monoTimer.start(300, 0);
var timer = setTimeout(function() { setTimeout(function() {
timerFired = true; timerFired = true;
}, 200); }, 200);

Loading…
Cancel
Save