File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1515 "react/event-loop" : " 0.3.*|0.4.*" ,
1616 "react/stream" : " ^0.4.2" ,
1717 "clue/utf8-react" : " ^0.1" ,
18- "clue/term-react" : " ^0.1"
18+ "clue/term-react" : " ^0.1.1 "
1919 },
2020 "autoload" : {
2121 "psr-4" : { "Clue\\ React\\ Stdio\\ " : " src/" }
Original file line number Diff line number Diff line change @@ -198,11 +198,22 @@ public function testDataEventWillBeEmittedForCompleteLine()
198198 $ this ->input ->emit ('data ' , array ("hello \n" ));
199199 }
200200
201- public function testDataEventWillNotBeEmittedForIncompleteLine ()
201+ public function testDataEventWillNotBeEmittedForIncompleteLineButWillStayInInputBuffer ()
202202 {
203203 $ this ->readline ->on ('data ' , $ this ->expectCallableNever ());
204204
205205 $ this ->input ->emit ('data ' , array ("hello " ));
206+
207+ $ this ->assertEquals ('hello ' , $ this ->readline ->getInput ());
208+ }
209+
210+ public function testDataEventWillBeEmittedForCompleteLineAndRemainingWillStayInInputBuffer ()
211+ {
212+ $ this ->readline ->on ('data ' , $ this ->expectCallableOnceWith ('hello ' ));
213+
214+ $ this ->input ->emit ('data ' , array ("hello \nworld " ));
215+
216+ $ this ->assertEquals ('world ' , $ this ->readline ->getInput ());
206217 }
207218
208219 public function testDataEventWillBeEmittedForEmptyLine ()
You can’t perform that action at this time.
0 commit comments