| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bb5511e commit bb6787c
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,13 +25,17 @@ stream.on('error', (err) => { throw err; }); | |||
| 25 | 25 | ||
| 26 | 26 | const size = kStringMaxLength / 200; | |
| 27 | 27 | const a = Buffer.alloc(size, 'a'); | |
| 28 | + let expectedSize = 0; | ||
| 28 | 29 | ||
| 29 | 30 | for (let i = 0; i < 201; i++) { | |
| 30 | - stream.write(a); | ||
| 31 | + stream.write(a, (err) => { assert.ifError(err); }); | ||
| 32 | + expectedSize += a.length; | ||
| 31 | 33 | } | |
| 32 | 34 | ||
| 33 | 35 | stream.end(); | |
| 34 | 36 | stream.on('finish', common.mustCall(function() { | |
| 37 | + assert.strictEqual(stream.bytesWritten, expectedSize, | ||
| 38 | + `${stream.bytesWritten} bytes written (expected ${expectedSize} bytes).`); | ||
| 35 | 39 | fs.readFile(file, 'utf8', common.mustCall(function(err, buf) { | |
| 36 | 40 | assert.ok(err instanceof Error); | |
| 37 | 41 | if (err.message !== 'Array buffer allocation failed') { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments