Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[tests] moved code from debugger's test to fixtures

  • Loading branch information...
commit 8481537e2b5eaf1910b20a5c181ec14d2c8fd5dd 1 parent 7f31dec
@indutny authored
Showing with 27 additions and 29 deletions.
  1. +16 −0 test/fixtures/breakpoints.js
  2. +11 −29 test/simple/test-debugger-repl.js
View
16 test/fixtures/breakpoints.js
@@ -0,0 +1,16 @@
+// wrapper line
+debugger;
+debugger;
+function a(x) {
+ var i = 10;
+ while (--i != 0);
+ debugger;
+ return i;
+};
+function b() {
+ return ['hello', 'world'].join(' ');
+};
+a();
+a(1);
+b();
+b();
View
40 test/simple/test-debugger-repl.js
@@ -25,24 +25,7 @@ var assert = require('assert');
var spawn = require('child_process').spawn;
var debug = require('_debugger');
-var code = [
- '',
- 'debugger;',
- 'debugger;',
- 'function a(x) {',
- ' var i = 10;',
- ' while (--i != 0);',
- ' debugger;',
- ' return i;',
- '}',
- 'function b() {',
- ' return ["hello", "world"].join(" ");',
- '}',
- 'a()',
- 'a(1)',
- 'b()',
- 'b()'
-].join('\n');
+var code = require('fs').readFileSync(common.fixturesDir + '/breakpoints.js');
var child = spawn(process.execPath, ['debug', '-e', code]);
@@ -102,10 +85,10 @@ addTest(null, [
addTest('n', [
"debug> debug> debug> break in [unnamed]:13",
" 11 return [\"hello\", \"world\"].join(\" \");",
- " 12 }",
- " 13 a()",
- " 14 a(1)",
- " 15 b()"
+ " 12 };",
+ " 13 a();",
+ " 14 a(1);",
+ " 15 b();"
]);
// Continue
@@ -115,23 +98,22 @@ addTest('c', [
" 6 while (--i != 0);",
" 7 debugger;",
" 8 return i;",
- " 9 }"
+ " 9 };"
]);
// Step out
addTest('o', [
"debug> debug> debug> break in [unnamed]:14",
- " 12 }",
- " 13 a()",
- " 14 a(1)",
- " 15 b()",
- " 16 b()"
+ " 12 };",
+ " 13 a();",
+ " 14 a(1);",
+ " 15 b();",
+ " 16 b();"
]);
function finish() {
- console.log('passed');
process.exit(0);
};
Please sign in to comment.
Something went wrong with that request. Please try again.