From 3311267f7526e4830b49281783395073b6be9d04 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 23 Dec 2015 01:33:56 -0800 Subject: [PATCH] test: remove unused `util` imports A number of tests in `test/parallel` were importing the `util` module via `require()` but not using `util` for anything. This removes those `require()` statements. PR-URL: https://github.com/nodejs/node/pull/4397 Reviewed-By: Colin Ihrig Reviewed-By: Rod Vagg --- test/parallel/test-beforeexit-event.js | 1 - test/parallel/test-child-process-fork-regr-gh-2847.js | 1 - test/parallel/test-cluster-worker-isconnected.js | 1 - test/parallel/test-file-write-stream2.js | 1 - test/parallel/test-file-write-stream3.js | 3 +-- test/parallel/test-http-buffer-sanity.js | 1 - test/parallel/test-http-head-request.js | 1 - test/parallel/test-http-keep-alive-close-on-header.js | 1 - test/parallel/test-pipe-return-val.js | 1 - test/parallel/test-repl-.save.load.js | 1 - test/parallel/test-repl-domain.js | 1 - test/parallel/test-repl-persistent-history.js | 1 - test/parallel/test-repl-syntax-error-stack.js | 1 - test/parallel/test-repl-tab-complete-crash.js | 1 - test/parallel/test-repl-tab-complete.js | 1 - test/parallel/test-repl-tab.js | 1 - test/parallel/test-stream2-push.js | 1 - test/parallel/test-url.js | 3 +-- 18 files changed, 2 insertions(+), 20 deletions(-) diff --git a/test/parallel/test-beforeexit-event.js b/test/parallel/test-beforeexit-event.js index f3bd127b408b08..8e5d66f5f5d7c7 100644 --- a/test/parallel/test-beforeexit-event.js +++ b/test/parallel/test-beforeexit-event.js @@ -1,7 +1,6 @@ 'use strict'; var assert = require('assert'); var net = require('net'); -var util = require('util'); var common = require('../common'); var revivals = 0; var deaths = 0; diff --git a/test/parallel/test-child-process-fork-regr-gh-2847.js b/test/parallel/test-child-process-fork-regr-gh-2847.js index 27b4d72d2fc612..f035b7fdc89eb8 100644 --- a/test/parallel/test-child-process-fork-regr-gh-2847.js +++ b/test/parallel/test-child-process-fork-regr-gh-2847.js @@ -5,7 +5,6 @@ const assert = require('assert'); const cluster = require('cluster'); const net = require('net'); -const util = require('util'); var connectcount = 0; var sendcount = 0; diff --git a/test/parallel/test-cluster-worker-isconnected.js b/test/parallel/test-cluster-worker-isconnected.js index eb3c5892bb5e21..985d15ce6475e6 100644 --- a/test/parallel/test-cluster-worker-isconnected.js +++ b/test/parallel/test-cluster-worker-isconnected.js @@ -2,7 +2,6 @@ require('../common'); var cluster = require('cluster'); var assert = require('assert'); -var util = require('util'); if (cluster.isMaster) { var worker = cluster.fork(); diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js index 0044548b736df0..e95760bc2d9a4e 100644 --- a/test/parallel/test-file-write-stream2.js +++ b/test/parallel/test-file-write-stream2.js @@ -4,7 +4,6 @@ var assert = require('assert'); var path = require('path'); var fs = require('fs'); -var util = require('util'); var filepath = path.join(common.tmpDir, 'write.txt'); diff --git a/test/parallel/test-file-write-stream3.js b/test/parallel/test-file-write-stream3.js index b6f0b8431828e6..ca4323965225c7 100644 --- a/test/parallel/test-file-write-stream3.js +++ b/test/parallel/test-file-write-stream3.js @@ -3,8 +3,7 @@ var common = require('../common'); var assert = require('assert'); var path = require('path'), - fs = require('fs'), - util = require('util'); + fs = require('fs'); var filepath = path.join(common.tmpDir, 'write_pos.txt'); diff --git a/test/parallel/test-http-buffer-sanity.js b/test/parallel/test-http-buffer-sanity.js index 4b120311d7dac9..98ce0f75b916a8 100644 --- a/test/parallel/test-http-buffer-sanity.js +++ b/test/parallel/test-http-buffer-sanity.js @@ -2,7 +2,6 @@ var common = require('../common'); var assert = require('assert'); var http = require('http'); -var util = require('util'); var bufferSize = 5 * 1024 * 1024; var measuredSize = 0; diff --git a/test/parallel/test-http-head-request.js b/test/parallel/test-http-head-request.js index 5a6f90507cf303..faf2168e36d0be 100644 --- a/test/parallel/test-http-head-request.js +++ b/test/parallel/test-http-head-request.js @@ -2,7 +2,6 @@ var common = require('../common'); var assert = require('assert'); var http = require('http'); -var util = require('util'); var body = 'hello world\n'; diff --git a/test/parallel/test-http-keep-alive-close-on-header.js b/test/parallel/test-http-keep-alive-close-on-header.js index 9ed6077b943aa8..83a0d0684cf637 100644 --- a/test/parallel/test-http-keep-alive-close-on-header.js +++ b/test/parallel/test-http-keep-alive-close-on-header.js @@ -2,7 +2,6 @@ var common = require('../common'); var assert = require('assert'); var http = require('http'); -var util = require('util'); var body = 'hello world\n'; var headers = {'connection': 'keep-alive'}; diff --git a/test/parallel/test-pipe-return-val.js b/test/parallel/test-pipe-return-val.js index 718d052cd24c27..2e27d07c19e9cf 100644 --- a/test/parallel/test-pipe-return-val.js +++ b/test/parallel/test-pipe-return-val.js @@ -4,7 +4,6 @@ var common = require('../common'); var Stream = require('stream').Stream; var assert = require('assert'); -var util = require('util'); var sourceStream = new Stream(); var destStream = new Stream(); diff --git a/test/parallel/test-repl-.save.load.js b/test/parallel/test-repl-.save.load.js index c71b383bcd7409..6d28015b385e15 100644 --- a/test/parallel/test-repl-.save.load.js +++ b/test/parallel/test-repl-.save.load.js @@ -1,6 +1,5 @@ 'use strict'; var assert = require('assert'); -var util = require('util'); var join = require('path').join; var fs = require('fs'); var common = require('../common'); diff --git a/test/parallel/test-repl-domain.js b/test/parallel/test-repl-domain.js index baf0485b3b80b2..0a3c7a609ac395 100644 --- a/test/parallel/test-repl-domain.js +++ b/test/parallel/test-repl-domain.js @@ -2,7 +2,6 @@ var assert = require('assert'); var common = require('../common'); -var util = require('util'); var repl = require('repl'); const putIn = new common.ArrayStream(); diff --git a/test/parallel/test-repl-persistent-history.js b/test/parallel/test-repl-persistent-history.js index 9b4b3890aed6cb..7571527b73800d 100644 --- a/test/parallel/test-repl-persistent-history.js +++ b/test/parallel/test-repl-persistent-history.js @@ -7,7 +7,6 @@ const stream = require('stream'); const REPL = require('internal/repl'); const assert = require('assert'); const fs = require('fs'); -const util = require('util'); const path = require('path'); const os = require('os'); diff --git a/test/parallel/test-repl-syntax-error-stack.js b/test/parallel/test-repl-syntax-error-stack.js index 647d3e3569ce00..11e335e285afb6 100644 --- a/test/parallel/test-repl-syntax-error-stack.js +++ b/test/parallel/test-repl-syntax-error-stack.js @@ -4,7 +4,6 @@ const common = require('../common'); const assert = require('assert'); const path = require('path'); const repl = require('repl'); -const util = require('util'); let found = false; process.on('exit', () => { diff --git a/test/parallel/test-repl-tab-complete-crash.js b/test/parallel/test-repl-tab-complete-crash.js index 484580f1e72fe5..ce283757438192 100644 --- a/test/parallel/test-repl-tab-complete-crash.js +++ b/test/parallel/test-repl-tab-complete-crash.js @@ -2,7 +2,6 @@ const common = require('../common'); const assert = require('assert'); -const util = require('util'); const repl = require('repl'); var referenceErrorCount = 0; diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 362e967146b275..5c0c9c516a3084 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -4,7 +4,6 @@ var common = require('../common'); var assert = require('assert'); -var util = require('util'); var repl = require('repl'); var referenceErrors = 0; var expectedReferenceErrors = 0; diff --git a/test/parallel/test-repl-tab.js b/test/parallel/test-repl-tab.js index 1ab3b4743913bd..6474d8e4088167 100644 --- a/test/parallel/test-repl-tab.js +++ b/test/parallel/test-repl-tab.js @@ -1,7 +1,6 @@ 'use strict'; require('../common'); var assert = require('assert'); -var util = require('util'); var repl = require('repl'); var zlib = require('zlib'); diff --git a/test/parallel/test-stream2-push.js b/test/parallel/test-stream2-push.js index b58bce143585f4..a225796d1e3120 100644 --- a/test/parallel/test-stream2-push.js +++ b/test/parallel/test-stream2-push.js @@ -5,7 +5,6 @@ var Readable = stream.Readable; var Writable = stream.Writable; var assert = require('assert'); -var util = require('util'); var EE = require('events').EventEmitter; diff --git a/test/parallel/test-url.js b/test/parallel/test-url.js index 5098c7e46ab6e6..0905f4e900329a 100644 --- a/test/parallel/test-url.js +++ b/test/parallel/test-url.js @@ -3,8 +3,7 @@ var common = require('../common'); var assert = require('assert'); -var url = require('url'), - util = require('util'); +var url = require('url'); // URLs to parse, and expected data // { url : parsed }