mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
e8d40154d8
Fixes: https://github.com/nodejs/node/issues/45992 PR-URL: https://github.com/nodejs/node/pull/46306 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
24 lines
522 B
JavaScript
24 lines
522 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
const assert = require('node:assert');
|
|
const readline = require('node:readline');
|
|
const { Readable } = require('node:stream');
|
|
|
|
|
|
const input = Readable.from((function*() {
|
|
yield 'a\nb';
|
|
yield '\r\n';
|
|
})());
|
|
const rl = readline.createInterface({ input, crlfDelay: Infinity });
|
|
let carriageReturns = 0;
|
|
|
|
rl.on('line', (line) => {
|
|
if (line.includes('\r')) carriageReturns++;
|
|
});
|
|
|
|
rl.on('close', common.mustCall(() => {
|
|
assert.strictEqual(carriageReturns, 0);
|
|
}));
|