Browse Source

test: remove unused assert module imports

Many test modules load assert but do not use it. This change removes
those instances.

It also removes a handful of other unused variables when they were
nearby.

PR-URL: https://github.com/nodejs/node/pull/4438
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v5.x
Rich Trott 9 years ago
committed by Jeremiah Senkpiel
parent
commit
ec0b6362cf
  1. 1
      test/addons/buffer-free-callback/test.js
  2. 1
      test/message/2100bytes.js
  3. 1
      test/message/eval_messages.js
  4. 1
      test/message/hello_world.js
  5. 1
      test/message/nexttick_throw.js
  6. 1
      test/message/stack_overflow.js
  7. 1
      test/message/stdin_messages.js
  8. 1
      test/message/throw_custom_error.js
  9. 2
      test/message/throw_custom_error.out
  10. 1
      test/message/throw_in_line_with_tabs.js
  11. 2
      test/message/throw_in_line_with_tabs.out
  12. 1
      test/message/throw_non_error.js
  13. 2
      test/message/throw_non_error.out
  14. 1
      test/message/throw_null.js
  15. 2
      test/message/throw_null.out
  16. 1
      test/message/throw_undefined.js
  17. 2
      test/message/throw_undefined.out
  18. 1
      test/message/timeout_throw.js
  19. 1
      test/message/undefined_reference_in_new_context.js
  20. 1
      test/message/vm_display_runtime_error.js
  21. 3
      test/message/vm_display_syntax_error.js
  22. 3
      test/message/vm_dont_display_runtime_error.js
  23. 1
      test/message/vm_dont_display_syntax_error.js
  24. 1
      test/parallel/test-cluster-dgram-2.js
  25. 1
      test/parallel/test-cluster-rr-ref.js
  26. 9
      test/parallel/test-crypto-verify-failure.js
  27. 2
      test/parallel/test-dgram-empty-packet.js
  28. 3
      test/parallel/test-dgram-send-empty-buffer.js
  29. 2
      test/parallel/test-domain-stack.js
  30. 3
      test/parallel/test-repl-domain.js
  31. 1
      test/parallel/test-require-extensions-main.js
  32. 1
      test/parallel/test-stream-pipe-cleanup-pause.js
  33. 1
      test/parallel/test-stream2-pipe-error-once-listener.js
  34. 1
      test/parallel/test-timers-non-integer-delay.js
  35. 1
      test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js
  36. 1
      test/parallel/test-timers-unref-remove-other-unref-timers.js
  37. 1
      test/parallel/test-timers-unrefd-interval-still-fires.js
  38. 1
      test/pummel/test-fs-watch-non-recursive.js
  39. 1
      test/pummel/test-http-upload-timeout.js
  40. 1
      test/pummel/test-next-tick-infinite-calls.js
  41. 1
      test/sequential/test-regress-GH-819.js
  42. 4
      test/sequential/test-stream2-stderr-sync.js

1
test/addons/buffer-free-callback/test.js

@ -2,7 +2,6 @@
// Flags: --expose-gc // Flags: --expose-gc
require('../../common'); require('../../common');
var assert = require('assert');
var binding = require('./build/Release/binding'); var binding = require('./build/Release/binding');
function check(size) { function check(size) {

1
test/message/2100bytes.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
var util = require('util'); var util = require('util');
console.log([ console.log([

1
test/message/eval_messages.js

@ -1,7 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;

1
test/message/hello_world.js

@ -1,5 +1,4 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
console.log('hello world'); console.log('hello world');

1
test/message/nexttick_throw.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
process.nextTick(function() { process.nextTick(function() {
process.nextTick(function() { process.nextTick(function() {

1
test/message/stack_overflow.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
Error.stackTraceLimit = 0; Error.stackTraceLimit = 0;

1
test/message/stdin_messages.js

@ -1,7 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;

1
test/message/throw_custom_error.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
// custom error throwing // custom error throwing
throw ({ name: 'MyCustomError', message: 'This is a custom message' }); throw ({ name: 'MyCustomError', message: 'This is a custom message' });

2
test/message/throw_custom_error.out

@ -1,4 +1,4 @@
*test*message*throw_custom_error.js:6 *test*message*throw_custom_error.js:5
throw ({ name: 'MyCustomError', message: 'This is a custom message' }); throw ({ name: 'MyCustomError', message: 'This is a custom message' });
^ ^
MyCustomError: This is a custom message MyCustomError: This is a custom message

1
test/message/throw_in_line_with_tabs.js

@ -1,7 +1,6 @@
/* eslint-disable indent */ /* eslint-disable indent */
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
console.error('before'); console.error('before');

2
test/message/throw_in_line_with_tabs.out

@ -1,5 +1,5 @@
before before
*test*message*throw_in_line_with_tabs.js:10 *test*message*throw_in_line_with_tabs.js:9
throw ({ foo: 'bar' }); throw ({ foo: 'bar' });
^ ^
[object Object] [object Object]

1
test/message/throw_non_error.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
// custom error throwing // custom error throwing
throw ({ foo: 'bar' }); throw ({ foo: 'bar' });

2
test/message/throw_non_error.out

@ -1,4 +1,4 @@
*test*message*throw_non_error.js:6 *test*message*throw_non_error.js:5
throw ({ foo: 'bar' }); throw ({ foo: 'bar' });
^ ^
[object Object] [object Object]

1
test/message/throw_null.js

@ -1,5 +1,4 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
throw null; throw null;

2
test/message/throw_null.out

@ -1,5 +1,5 @@
*test*message*throw_null.js:5 *test*message*throw_null.js:4
throw null; throw null;
^ ^
null null

1
test/message/throw_undefined.js

@ -1,5 +1,4 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
throw undefined; throw undefined;

2
test/message/throw_undefined.out

@ -1,5 +1,5 @@
*test*message*throw_undefined.js:5 *test*message*throw_undefined.js:4
throw undefined; throw undefined;
^ ^
undefined undefined

1
test/message/timeout_throw.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
setTimeout(function() { setTimeout(function() {
undefined_reference_error_maker; undefined_reference_error_maker;

1
test/message/undefined_reference_in_new_context.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
var vm = require('vm'); var vm = require('vm');
console.error('before'); console.error('before');

1
test/message/vm_display_runtime_error.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
var vm = require('vm'); var vm = require('vm');
console.error('beginning'); console.error('beginning');

3
test/message/vm_display_syntax_error.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
var common = require('../common'); require('../common');
var assert = require('assert');
var vm = require('vm'); var vm = require('vm');
console.error('beginning'); console.error('beginning');

3
test/message/vm_dont_display_runtime_error.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
var common = require('../common'); require('../common');
var assert = require('assert');
var vm = require('vm'); var vm = require('vm');
console.error('beginning'); console.error('beginning');

1
test/message/vm_dont_display_syntax_error.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
var vm = require('vm'); var vm = require('vm');
console.error('beginning'); console.error('beginning');

1
test/parallel/test-cluster-dgram-2.js

@ -2,7 +2,6 @@
var NUM_WORKERS = 4; var NUM_WORKERS = 4;
var PACKETS_PER_WORKER = 10; var PACKETS_PER_WORKER = 10;
var assert = require('assert');
var cluster = require('cluster'); var cluster = require('cluster');
var common = require('../common'); var common = require('../common');
var dgram = require('dgram'); var dgram = require('dgram');

1
test/parallel/test-cluster-rr-ref.js

@ -1,7 +1,6 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
const assert = require('assert');
const cluster = require('cluster'); const cluster = require('cluster');
const net = require('net'); const net = require('net');

9
test/parallel/test-crypto-verify-failure.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
var common = require('../common'); var common = require('../common');
var assert = require('assert');
if (!common.hasCrypto) { if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto'); console.log('1..0 # Skipped: missing crypto');
@ -20,8 +19,6 @@ var options = {
cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem')
}; };
var canSend = true;
var server = tls.Server(options, function(socket) { var server = tls.Server(options, function(socket) {
setImmediate(function() { setImmediate(function() {
console.log('sending'); console.log('sending');
@ -32,17 +29,15 @@ var server = tls.Server(options, function(socket) {
}); });
}); });
var client;
function verify() { function verify() {
console.log('verify'); console.log('verify');
var verified = crypto.createVerify('RSA-SHA1') crypto.createVerify('RSA-SHA1')
.update('Test') .update('Test')
.verify(certPem, 'asdfasdfas', 'base64'); .verify(certPem, 'asdfasdfas', 'base64');
} }
server.listen(common.PORT, function() { server.listen(common.PORT, function() {
client = tls.connect({ tls.connect({
port: common.PORT, port: common.PORT,
rejectUnauthorized: false rejectUnauthorized: false
}, function() { }, function() {

2
test/parallel/test-dgram-empty-packet.js

@ -1,8 +1,6 @@
'use strict'; 'use strict';
var common = require('../common'); var common = require('../common');
var assert = require('assert');
var fs = require('fs');
var dgram = require('dgram'); var dgram = require('dgram');
var callbacks = 0; var callbacks = 0;
var client; var client;

3
test/parallel/test-dgram-send-empty-buffer.js

@ -1,10 +1,7 @@
'use strict'; 'use strict';
var common = require('../common'); var common = require('../common');
var assert = require('assert');
var fs = require('fs');
var dgram = require('dgram'); var dgram = require('dgram');
var callbacks = 0;
var client, timer, buf; var client, timer, buf;
if (process.platform === 'darwin') { if (process.platform === 'darwin') {

2
test/parallel/test-domain-stack.js

@ -2,9 +2,7 @@
// Make sure that the domain stack doesn't get out of hand. // Make sure that the domain stack doesn't get out of hand.
require('../common'); require('../common');
var assert = require('assert');
var domain = require('domain'); var domain = require('domain');
var events = require('events');
var a = domain.create(); var a = domain.create();
a.name = 'a'; a.name = 'a';

3
test/parallel/test-repl-domain.js

@ -1,11 +1,10 @@
'use strict'; 'use strict';
var assert = require('assert');
var common = require('../common'); var common = require('../common');
var repl = require('repl'); var repl = require('repl');
const putIn = new common.ArrayStream(); const putIn = new common.ArrayStream();
var testMe = repl.start('', putIn); repl.start('', putIn);
putIn.write = function(data) { putIn.write = function(data) {
// Don't use assert for this because the domain might catch it, and // Don't use assert for this because the domain might catch it, and

1
test/parallel/test-require-extensions-main.js

@ -1,5 +1,4 @@
'use strict'; 'use strict';
var common = require('../common'); var common = require('../common');
var assert = require('assert');
require(common.fixturesDir + '/require-bin/bin/req.js'); require(common.fixturesDir + '/require-bin/bin/req.js');

1
test/parallel/test-stream-pipe-cleanup-pause.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
const assert = require('assert');
const stream = require('stream'); const stream = require('stream');
const reader = new stream.Readable(); const reader = new stream.Readable();

1
test/parallel/test-stream2-pipe-error-once-listener.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
var util = require('util'); var util = require('util');
var stream = require('stream'); var stream = require('stream');

1
test/parallel/test-timers-non-integer-delay.js

@ -16,7 +16,6 @@
*/ */
require('../common'); require('../common');
var assert = require('assert');
var TIMEOUT_DELAY = 1.1; var TIMEOUT_DELAY = 1.1;
var NB_TIMEOUTS_FIRED = 50; var NB_TIMEOUTS_FIRED = 50;

1
test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js

@ -5,7 +5,6 @@
*/ */
const common = require('../common'); const common = require('../common');
const assert = require('assert');
const net = require('net'); const net = require('net');
const clients = []; const clients = [];

1
test/parallel/test-timers-unref-remove-other-unref-timers.js

@ -7,7 +7,6 @@
* considered public interface. * considered public interface.
*/ */
const common = require('../common'); const common = require('../common');
const assert = require('assert');
const timers = require('timers'); const timers = require('timers');
const foo = { const foo = {

1
test/parallel/test-timers-unrefd-interval-still-fires.js

@ -3,7 +3,6 @@
* This test is a regression test for joyent/node#8900. * This test is a regression test for joyent/node#8900.
*/ */
const common = require('../common'); const common = require('../common');
const assert = require('assert');
const TEST_DURATION = common.platformTimeout(100); const TEST_DURATION = common.platformTimeout(100);
const N = 5; const N = 5;

1
test/pummel/test-fs-watch-non-recursive.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
var common = require('../common'); var common = require('../common');
var assert = require('assert');
var path = require('path'); var path = require('path');
var fs = require('fs'); var fs = require('fs');

1
test/pummel/test-http-upload-timeout.js

@ -3,7 +3,6 @@
// data in random intervals. Clients are also randomly disconnecting until there // data in random intervals. Clients are also randomly disconnecting until there
// are no more clients left. If no false timeout occurs, this test has passed. // are no more clients left. If no false timeout occurs, this test has passed.
var common = require('../common'), var common = require('../common'),
assert = require('assert'),
http = require('http'), http = require('http'),
server = http.createServer(), server = http.createServer(),
connections = 0; connections = 0;

1
test/pummel/test-next-tick-infinite-calls.js

@ -1,6 +1,5 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert');
var complete = 0; var complete = 0;

1
test/sequential/test-regress-GH-819.js

@ -1,7 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var net = require('net'); var net = require('net');
var assert = require('assert');
// Connect to something that we need to DNS resolve // Connect to something that we need to DNS resolve
var c = net.createConnection(80, 'google.com'); var c = net.createConnection(80, 'google.com');

4
test/sequential/test-stream2-stderr-sync.js

@ -2,10 +2,6 @@
// Make sure that sync writes to stderr get processed before exiting. // Make sure that sync writes to stderr get processed before exiting.
require('../common'); require('../common');
var assert = require('assert');
var util = require('util');
var errnoException = util._errnoException;
function parent() { function parent() {
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;

Loading…
Cancel
Save