Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use portable EOL #32104

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup: address review comment
  • Loading branch information
HarshithaKP committed Mar 6, 2020
commit 36943ab4b019cf5cf7e8b49cc9825496defdd01f
5 changes: 2 additions & 3 deletions test/parallel/test-child-process-pipe-dataflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ const MB = KB * KB;
{
tmpdir.refresh();
const file = path.resolve(tmpdir.path, 'data.txt');
let buf = Buffer.alloc(MB).fill('x');
const buf = Buffer.alloc(MB).fill('x');

// Most OS commands that deal with data, attach special
// meanings to new line - for example, line buffering.
// So cut the buffer into lines at some points, forcing
// data flow to be split in the stream.
const eol_len = os.EOL.length;
for (let i = 0; i < KB; i++)
buf = buf.fill(os.EOL, i * KB, (i * KB + eol_len));
buf.write(os.EOL, i * KB);
fs.writeFileSync(file, buf.toString());

cat = spawn('cat', [file]);
Expand Down