| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f43a876 commit 3135455
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,26 +4,26 @@ var assert = require('assert'); | |||
| 4 | 4 | ||
| 5 | 5 | var spawn = require('child_process').spawn; | |
| 6 | 6 | ||
| 7 | - var SIZE = 1000 * 1024; | ||
| 8 | - var N = 40; | ||
| 9 | - var finished = false; | ||
| 7 | + const SIZE = 1000 * 1024; | ||
| 8 | + const N = 40; | ||
| 9 | + let finished = false; | ||
| 10 | 10 | ||
| 11 | 11 | function doSpawn(i) { | |
| 12 | - var child = spawn('python', ['-c', 'print ' + SIZE + ' * "C"']); | ||
| 13 | - var count = 0; | ||
| 12 | + const child = spawn('python', ['-c', 'print ' + SIZE + ' * "C"']); | ||
| 13 | + let count = 0; | ||
| 14 | 14 | ||
| 15 | 15 | child.stdout.setEncoding('ascii'); | |
| 16 | - child.stdout.on('data', function(chunk) { | ||
| 16 | + child.stdout.on('data', (chunk) => { | ||
| 17 | 17 | count += chunk.length; | |
| 18 | 18 | }); | |
| 19 | 19 | ||
| 20 | - child.stderr.on('data', function(chunk) { | ||
| 20 | + child.stderr.on('data', (chunk) => { | ||
| 21 | 21 | console.log('stderr: ' + chunk); | |
| 22 | 22 | }); | |
| 23 | 23 | ||
| 24 | - child.on('close', function() { | ||
| 24 | + child.on('close', () => { | ||
| 25 | 25 | // + 1 for \n or + 2 for \r\n on Windows | |
| 26 | - assert.equal(SIZE + (common.isWindows ? 2 : 1), count); | ||
| 26 | + assert.strictEqual(SIZE + (common.isWindows ? 2 : 1), count); | ||
| 27 | 27 | if (i < N) { | |
| 28 | 28 | doSpawn(i + 1); | |
| 29 | 29 | } else { | |
@@ -34,6 +34,6 @@ function doSpawn(i) { | |||
| 34 | 34 | ||
| 35 | 35 | doSpawn(0); | |
| 36 | 36 | ||
| 37 | - process.on('exit', function() { | ||
| 37 | + process.on('exit', () => { | ||
| 38 | 38 | assert.ok(finished); | |
| 39 | 39 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments