| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e83dcde commit c0af3ac
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,7 @@ const common = require('../common'); | |||
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | const path = require('path'); | |
| 5 | 5 | const fs = require('fs'); | |
| 6 | + const os = require('os'); | ||
| 6 | 7 | const spawn = require('child_process').spawn; | |
| 7 | 8 | const tmpdir = require('../common/tmpdir'); | |
| 8 | 9 | ||
@@ -25,8 +26,8 @@ const MB = KB * KB; | |||
| 25 | 26 | // meanings to new line - for example, line buffering. | |
| 26 | 27 | // So cut the buffer into lines at some points, forcing | |
| 27 | 28 | // data flow to be split in the stream. | |
| 28 | - for (let i = 0; i < KB; i++) | ||
| 29 | - buf[i * KB] = 10; | ||
| 29 | + for (let i = 1; i < KB; i++) | ||
| 30 | + buf.write(os.EOL, i * KB); | ||
| 30 | 31 | fs.writeFileSync(file, buf.toString()); | |
| 31 | 32 | ||
| 32 | 33 | cat = spawn('cat', [file]); | |
@@ -61,6 +62,7 @@ const MB = KB * KB; | |||
| 61 | 62 | }); | |
| 62 | 63 | ||
| 63 | 64 | wc.stdout.on('data', common.mustCall((data) => { | |
| 64 | - assert.strictEqual(data.toString().trim(), MB.toString()); | ||
| 65 | + // Grep always adds one extra byte at the end. | ||
| 66 | + assert.strictEqual(data.toString().trim(), (MB + 1).toString()); | ||
| 65 | 67 | })); | |
| 66 | 68 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments