GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: use portable EOL · nodejs/node@776905e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-child-process-pipe-dataflow.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-child-process-pipe-dataflow.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-pipe-dataflow.js
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const common = require('../common');
33
const assert = require('assert');
44
const path = require('path');
55
const fs = require('fs');
6+
const os = require('os');
67
const spawn = require('child_process').spawn;
78
const tmpdir = require('../common/tmpdir');
89

@@ -25,8 +26,8 @@ const MB = KB * KB;
2526
// meanings to new line - for example, line buffering.
2627
// So cut the buffer into lines at some points, forcing
2728
// 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);
3031
fs.writeFileSync(file, buf.toString());
3132

3233
cat = spawn('cat', [file]);
@@ -61,6 +62,7 @@ const MB = KB * KB;
6162
});
6263

6364
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());
6567
}));
6668
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.