forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: nodejs#55484 Refs: v8/v8@f915fa4 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
- Loading branch information
1 parent
e852a8d
commit 42e06e1
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const ArrayStream = require('../common/arraystream'); | ||
const assert = require('assert'); | ||
const repl = require('repl'); | ||
|
||
common.skipIfInspectorDisabled(); | ||
|
||
const inputStream = new ArrayStream(); | ||
const outputStream = new ArrayStream(); | ||
repl.start({ | ||
input: inputStream, | ||
output: outputStream, | ||
useGlobal: false, | ||
terminal: true, | ||
useColors: true | ||
}); | ||
|
||
let output = ''; | ||
outputStream.write = (chunk) => output += chunk; | ||
|
||
// Input without '\n' triggering actual run. | ||
const input = 'while (true) {}'; | ||
inputStream.emit('data', input); | ||
// No preview available when timed out. | ||
assert.strictEqual(output, input); |