@@ -7,7 +7,6 @@ const REPL = require('repl');
77const assert = require ( 'assert' ) ;
88const fs = require ( 'fs' ) ;
99const os = require ( 'os' ) ;
10- const util = require ( 'util' ) ;
1110
1211if ( process . env . TERM === 'dumb' ) {
1312 common . skip ( 'skipping - dumb terminal' ) ;
@@ -29,21 +28,19 @@ class ActionStream extends stream.Stream {
2928 const next = _iter . next ( ) ;
3029 if ( next . done ) {
3130 // Close the repl. Note that it must have a clean prompt to do so.
32- setImmediate ( ( ) => {
33- this . emit ( 'keypress' , '' , { ctrl : true , name : 'd' } ) ;
34- } ) ;
31+ this . emit ( 'keypress' , '' , { ctrl : true , name : 'd' } ) ;
3532 return ;
3633 }
3734 const action = next . value ;
3835
3936 if ( typeof action === 'object' ) {
4037 this . emit ( 'keypress' , '' , action ) ;
4138 } else {
42- this . emit ( 'data' , `${ action } \n ` ) ;
39+ this . emit ( 'data' , `${ action } ` ) ;
4340 }
4441 setImmediate ( doAction ) ;
4542 } ;
46- setImmediate ( doAction ) ;
43+ doAction ( ) ;
4744 }
4845 resume ( ) { }
4946 pause ( ) { }
@@ -95,10 +92,8 @@ const tests = [
9592 test : [ UP , '21' , ENTER , "'42'" , ENTER ] ,
9693 expected : [
9794 prompt ,
98- // TODO(BridgeAR): The line is refreshed too many times. The double prompt
99- // is redundant and can be optimized away.
100- '2' , '1' , '21\n' , prompt , prompt ,
101- "'" , '4' , '2' , "'" , "'42'\n" , prompt , prompt ,
95+ '2' , '1' , '21\n' , prompt ,
96+ "'" , '4' , '2' , "'" , "'42'\n" , prompt ,
10297 ] ,
10398 clean : false
10499 } ,
@@ -191,8 +186,6 @@ function runTest(assertCleaned) {
191186 const opts = tests . shift ( ) ;
192187 if ( ! opts ) return ; // All done
193188
194- console . log ( 'NEW' ) ;
195-
196189 if ( assertCleaned ) {
197190 try {
198191 assert . strictEqual ( fs . readFileSync ( defaultHistoryPath , 'utf8' ) , '' ) ;
@@ -218,7 +211,6 @@ function runTest(assertCleaned) {
218211 output : new stream . Writable ( {
219212 write ( chunk , _ , next ) {
220213 const output = chunk . toString ( ) ;
221- console . log ( 'INPUT' , util . inspect ( output ) ) ;
222214
223215 // Ignore escapes and blank lines
224216 if ( output . charCodeAt ( 0 ) === 27 || / ^ [ \r \n ] + $ / . test ( output ) )
0 commit comments