Permalink
Browse files

debugger: watch test

  • Loading branch information...
1 parent 26f386c commit 2b579a3d6efaba0635990fd0ec6d1c3ae50fca3f @indutny committed Sep 29, 2011
Showing with 24 additions and 1 deletion.
  1. +24 −1 test/simple/test-debugger-repl.js
@@ -46,7 +46,7 @@ child.on('line', function(line) {
assert.ok(expected.length > 0, 'Got unexpected line: ' + line);
var expectedLine = expected[0].lines.shift();
- assert.ok(line.match(expectedLine) !== null);
+ assert.ok(line.match(expectedLine) !== null, expectedLine);
if (expected[0].lines.length === 0) {
var callback = expected[0].callback;
@@ -59,6 +59,15 @@ function addTest(input, output) {
function next() {
if (expected.length > 0) {
child.stdin.write(expected[0].input + '\n');
+
+ if (!expected[0].lines) {
+ process.nextTick(function() {
+ var callback = expected[0].callback;
+ expected.shift();
+
+ callback && callback();
+ });
+ }
} else {
finish();
}
@@ -80,12 +89,26 @@ addTest('n', [
/11/, /12/, /13/, /14/, /15/
]);
+// Watch
+addTest('watch("\'x\'")');
+
// Continue
addTest('c', [
/break in .*:7/,
+ /Watchers/,
+ /0:\s+'x' = "x"/,
+ /()/,
/5/, /6/, /7/, /8/, /9/
]);
+// Show watchers
+addTest('watchers', [
+ /0:\s+'x' = "x"/
+]);
+
+// Unwatch
+addTest('unwatch("\'x\'")');
+
// Step out
addTest('o', [
/break in .*:14/,

0 comments on commit 2b579a3

Please sign in to comment.