~ubuntu-branches/ubuntu/saucy/nodejs/saucy-proposed

« back to all changes in this revision

Viewing changes to test/simple/test-debugger-repl-break-in-module.js

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-08-14 00:16:46 UTC
  • mfrom: (7.1.40 sid)
  • Revision ID: package-import@ubuntu.com-20130814001646-bzlysfh8sd6mukbo
Tags: 0.10.15~dfsg1-4
* Update 2005 patch, adding a handful of tests that can fail on
  slow platforms.
* Add 1004 patch to fix test failures when writing NaN to buffer
  on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright Joyent, Inc. and other Node contributors.
 
2
//
 
3
// Permission is hereby granted, free of charge, to any person obtaining a
 
4
// copy of this software and associated documentation files (the
 
5
// "Software"), to deal in the Software without restriction, including
 
6
// without limitation the rights to use, copy, modify, merge, publish,
 
7
// distribute, sublicense, and/or sell copies of the Software, and to permit
 
8
// persons to whom the Software is furnished to do so, subject to the
 
9
// following conditions:
 
10
//
 
11
// The above copyright notice and this permission notice shall be included
 
12
// in all copies or substantial portions of the Software.
 
13
//
 
14
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
15
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
16
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
 
17
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 
18
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 
19
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 
20
// USE OR OTHER DEALINGS IN THE SOFTWARE.
 
21
 
 
22
var repl = require('./helper-debugger-repl.js');
 
23
 
 
24
repl.startDebugger('break-in-module/main.js');
 
25
 
 
26
// -- SET BREAKPOINT --
 
27
 
 
28
// Set breakpoint by file name + line number where the file is not loaded yet
 
29
repl.addTest('sb("mod.js", 23)', [
 
30
  /Warning: script 'mod\.js' was not loaded yet\./,
 
31
  /1/, /2/, /3/, /4/, /5/, /6/
 
32
]);
 
33
 
 
34
// Check escaping of regex characters
 
35
repl.addTest('sb(")^$*+?}{|][(.js\\\\", 1)', [
 
36
  /Warning: script '[^']+' was not loaded yet\./,
 
37
  /1/, /2/, /3/, /4/, /5/, /6/
 
38
]);
 
39
 
 
40
// continue - the breakpoint should be triggered
 
41
repl.addTest('c', [
 
42
    /break in .*[\\\/]mod\.js:23/,
 
43
    /21/, /22/, /23/, /24/, /25/
 
44
]);
 
45
 
 
46
// -- RESTORE BREAKPOINT ON RESTART --
 
47
 
 
48
// Restart the application - breakpoint should be restored
 
49
repl.addTest('restart', [].concat(
 
50
  [
 
51
    /terminated/
 
52
  ],
 
53
  repl.handshakeLines,
 
54
  [
 
55
    /Restoring breakpoint mod.js:23/,
 
56
    /Warning: script 'mod\.js' was not loaded yet\./,
 
57
    /Restoring breakpoint \).*:\d+/,
 
58
    /Warning: script '\)[^']*' was not loaded yet\./
 
59
  ],
 
60
  repl.initialBreakLines));
 
61
 
 
62
// continue - the breakpoint should be triggered
 
63
repl.addTest('c', [
 
64
  /break in .*[\\\/]mod\.js:23/,
 
65
  /21/, /22/, /23/, /24/, /25/
 
66
]);
 
67
 
 
68
// -- CLEAR BREAKPOINT SET IN MODULE TO BE LOADED --
 
69
 
 
70
repl.addTest('cb("mod.js", 23)', [
 
71
  /18/, /./, /./, /./, /./, /./, /./, /./, /26/
 
72
]);
 
73
 
 
74
repl.addTest('c', [
 
75
  /break in .*[\\\/]main\.js:4/,
 
76
  /2/, /3/, /4/, /5/, /6/
 
77
]);
 
78
 
 
79
// -- (END) --
 
80
repl.addTest('quit', []);