File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const assert = require('node:assert');
4
4
const readline = require ( 'node:readline' ) ;
5
5
const { Readable } = require ( 'node:stream' ) ;
6
6
7
- const str = '123\n456\r789 \u{2028}ABC\u{2029}DEF' ;
7
+ const str = '012\n345\r67\r\n89 \u{2028}ABC\u{2029}DEF' ;
8
8
9
9
const rli = new readline . Interface ( {
10
10
input : Readable . from ( str ) ,
@@ -14,7 +14,7 @@ const linesRead = [];
14
14
rli . on ( 'line' , ( line ) => linesRead . push ( line ) ) ;
15
15
16
16
rli . on ( 'close' , common . mustCall ( ( ) => {
17
- const regexpLines = str . split ( / ^ / m) . map ( ( line ) => line . trim ( ) ) ;
17
+ const regexpLines = str . split ( / ^ / m) . map ( ( line ) => line . trim ( ) ) . filter ( Boolean ) ;
18
18
// Readline interprets different lines in the same way js regular expressions do
19
19
assert . deepStrictEqual ( linesRead , regexpLines ) ;
20
20
} ) ) ;
You can’t perform that action at this time.
0 commit comments