Permalink
Browse files

test: fix debugger-repl test again

  • Loading branch information...
1 parent a7c8a52 commit 3b6255d2046efe28512184828f82620fbfa3e335 @indutny committed Nov 5, 2011
Showing with 13 additions and 8 deletions.
  1. +13 −8 test/simple/test-debugger-repl.js
@@ -58,15 +58,20 @@ child.on('line', function(line) {
function addTest(input, output) {
function next() {
if (expected.length > 0) {
- child.stdin.write(expected[0].input + '\n');
+ var res = child.stdin.write(expected[0].input + '\n'),
+ callback;
if (!expected[0].lines) {
- child.stdin.on('drain', function() {
- var callback = expected[0].callback;
- expected.shift();
+ callback = expected[0].callback;
+ expected.shift();
+ }
- callback && callback();
- });
+ if (callback) {
+ if (res !== true) {
+ child.stdin.on('drain', callback);
+ } else {
+ process.nextTick(callback);
+ }
}
} else {
finish();
@@ -90,7 +95,7 @@ addTest('n', [
]);
// Watch
-addTest('watch("\'x\'")');
+addTest('watch("\'x\'"), true', [/true/]);
// Continue
addTest('c', [
@@ -107,7 +112,7 @@ addTest('watchers', [
]);
// Unwatch
-addTest('unwatch("\'x\'")');
+addTest('unwatch("\'x\'"), true', [ /true/ ]);
// Step out
addTest('o', [

0 comments on commit 3b6255d

Please sign in to comment.