Changeset 9680
- Timestamp:
- 12/14/09 01:26:37 (2 years ago)
- Location:
- trunk/Debug-Client
- Files:
-
- 15 edited
-
Changes (modified) (1 diff)
-
lib/Debug/Client.pm (modified) (14 diffs)
-
t/01-add.t (modified) (3 diffs)
-
t/02-sub-step_out.t (modified) (4 diffs)
-
t/02-sub-step_over.t (modified) (3 diffs)
-
t/02-sub.t (modified) (9 diffs)
-
t/03-return.t (modified) (7 diffs)
-
t/04-run.t (modified) (2 diffs)
-
t/04-run_to_line.t (modified) (3 diffs)
-
t/04-run_to_sub.t (modified) (3 diffs)
-
t/05-execute.t (modified) (8 diffs)
-
t/06-breakpoint.t (modified) (4 diffs)
-
t/07-quit.t (modified) (2 diffs)
-
t/08-recursive.t (modified) (7 diffs)
-
t/09-io.t (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Debug-Client/Changes
r9669 r9680 1 v0.06 2 Prompt is now the first return paramter 3 Added more tests 4 Added more documentation 5 1 6 v0.05 2009.12.13 2 7 Try to eliminate infinite loop -
trunk/Debug-Client/lib/Debug/Client.pm
r9676 r9680 31 31 32 32 33 my ($ module, $file, $row, $content, $prompt) = $debugger->step_in;34 my ($ module, $file, $row, $content, $prompt, $return_value) = $debugger->step_out;35 my ($ value, $prompt) = $debugger->get_value('$x');33 my ($prompt, $module, $file, $row, $content) = $debugger->step_in; 34 my ($prompt, $module, $file, $row, $content, $return_value) = $debugger->step_out; 35 my ($prompt, $value) = $debugger->get_value('$x'); 36 36 37 37 $debugger->run(); # run till end of breakpoint or watch … … 43 43 $debugger->execute_code( '@name = qw(foo bar)' ); 44 44 45 my ($ value, $prompt) = $debugger->get_value('@name'); $value is the dumped data?45 my ($prompt, $value) = $debugger->get_value('@name'); $value is the dumped data? 46 46 47 47 $debugger->execute_code( '%phone_book = (foo => 123, bar => 456)' ); 48 48 49 my ($ value, $prompt) = $debugger->get_value('%phone_book'); $value is the dumped data?49 my ($prompt, $value) = $debugger->get_value('%phone_book'); $value is the dumped data? 50 50 51 51 … … 70 70 =cut 71 71 72 72 =head2 new 73 74 The constructor can get two parameters: host and port. 75 76 my $d = Debug::Client->new; 77 78 my $d = Debug::Client->new(host => 'remote.hots.com', port => 4242); 79 80 Immediately after the object creation one needs to call 81 82 $d->listen; 83 84 TODO: Is there any reason to separate the two? 85 86 =cut 73 87 74 88 sub new { … … 93 107 } 94 108 109 =head2 listen 110 111 See C<new> 112 113 =cut 114 95 115 sub listen { 96 116 my ($self) = @_; 97 117 98 118 $self->{new_sock} = $self->{sock}->accept(); 119 99 120 return; 100 101 121 } 102 122 103 123 =head2 buffer 104 124 105 returnthe content of the buffer since the last command125 Returns the content of the buffer since the last command 106 126 107 127 $debugger->buffer; … … 145 165 sub step_out { 146 166 my ($self) = @_; 167 147 168 $self->_send('r'); 148 169 my $buf = $self->_get; … … 170 191 # TODO can we parse this inteligently in the general case? 171 192 #} 172 return ( @line, $prompt, $ret);193 return ($prompt, @line, $ret); 173 194 } else { 174 195 return $buf; … … 188 209 if (wantarray) { 189 210 my $prompt = _prompt(\$buf); 190 return($ buf, $prompt);211 return($prompt, $buf); 191 212 } else { 192 213 return $buf; … … 195 216 196 217 =head2 run 218 219 $d->run; 220 221 Will run till the next breakpoint or watch or the end of 222 the script. (Like pressing c in the debugger). 223 224 $d->run($param) 225 197 226 198 227 =cut … … 209 238 =head2 set_breakpoint 210 239 240 $d->set_breakpoint($file, $line, $condition); 241 211 242 =cut 212 243 … … 223 254 if (wantarray) { 224 255 my $prompt = _prompt(\$buf); 225 return($ buf, $prompt);256 return($prompt, $buf); 226 257 } else { 227 258 return $buf; … … 240 271 if (wantarray) { 241 272 my $prompt = _prompt(\$buf); 242 return ($ buf, $prompt);273 return ($prompt, $buf); 243 274 } else { 244 275 return $buf; … … 261 292 if (wantarray) { 262 293 my $prompt = _prompt(\$buf); 263 return ($ buf, $prompt);294 return ($prompt, $buf); 264 295 } else { 265 296 return $buf … … 271 302 my $prompt = _prompt(\$buf); 272 303 my $data_ref = _parse_dumper($buf); 273 return ($ data_ref, $prompt);304 return ($prompt, $data_ref); 274 305 } else { 275 306 return $buf … … 341 372 my $prompt = _prompt(\$buf); 342 373 my ($module, $file, $row, $content) = _process_line(\$buf); 343 return ($ module, $file, $row, $content, $prompt);374 return ($prompt, $module, $file, $row, $content); 344 375 } else { 345 376 return $buf; -
trunk/Debug-Client/t/01-add.t
r9657 r9680 10 10 require Test::Deep; 11 11 import Test::Deep; 12 my $ D= re('\d+');12 my $PROMPT = re('\d+'); 13 13 14 14 plan(tests => 7); … … 37 37 { 38 38 my @out = $debugger->step_in; 39 cmp_deeply(\@out, [ 'main::', 't/eg/01-add.pl', 6, 'my $x = 1;', $D], 'line 6')39 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/01-add.pl', 6, 'my $x = 1;'], 'line 6') 40 40 or diag($debugger->buffer); 41 41 } 42 42 { 43 43 my @out = $debugger->step_in; 44 cmp_deeply(\@out, [ 'main::', 't/eg/01-add.pl', 7, 'my $y = 2;', $D], 'line 7')44 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/01-add.pl', 7, 'my $y = 2;'], 'line 7') 45 45 or diag($debugger->buffer); 46 46 } … … 48 48 { 49 49 my @out = $debugger->show_line; 50 cmp_deeply(\@out, [ 'main::', 't/eg/01-add.pl', 7, 'my $y = 2;', $D], 'line 7')50 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/01-add.pl', 7, 'my $y = 2;'], 'line 7') 51 51 or diag($debugger->buffer); 52 52 } 53 53 { 54 54 my @out = $debugger->step_in; 55 cmp_deeply(\@out, [ 'main::', 't/eg/01-add.pl', 8, 'my $z = $x + $y;', $D], 'line 8')55 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/01-add.pl', 8, 'my $z = $x + $y;'], 'line 8') 56 56 or diag($debugger->buffer); 57 57 } -
trunk/Debug-Client/t/02-sub-step_out.t
r9659 r9680 10 10 require Test::Deep; 11 11 import Test::Deep; 12 my $ D= re('\d+');12 my $PROMPT = re('\d+'); 13 13 14 14 plan(tests => 11); … … 33 33 { 34 34 my @out = $debugger->step_in; 35 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;', $D], 'line 6');35 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;'], 'line 6'); 36 36 } 37 37 { 38 38 my @out = $debugger->step_in; 39 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 7, 'my $y = 22;', $D], 'line 7');39 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 7, 'my $y = 22;'], 'line 7'); 40 40 } 41 41 42 42 { 43 43 my @out = $debugger->step_in; 44 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 8, 'my $q = f($x, $y);', $D], 'line 8');44 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 8, 'my $q = f($x, $y);'], 'line 8'); 45 45 } 46 46 47 47 { 48 48 my @out = $debugger->step_in; 49 cmp_deeply(\@out, [ 'main::f', 't/eg/02-sub.pl', 13, ' my ($q, $w) = @_;', $D], 'line 13');49 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 13, ' my ($q, $w) = @_;'], 'line 13'); 50 50 } 51 51 52 52 { 53 53 my @out = $debugger->step_in; 54 cmp_deeply(\@out, [ 'main::f', 't/eg/02-sub.pl', 14, ' my $multi = $q * $w;', $D], 'line 14')54 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 14, ' my $multi = $q * $w;'], 'line 14') 55 55 or diag($debugger->buffer); 56 56 } … … 58 58 { 59 59 my @out = $debugger->step_out; 60 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 9, 'my $z = $x + $y;', $D, 242], 'line 9')60 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 9, 'my $z = $x + $y;', 242], 'line 9') 61 61 or diag($debugger->buffer); 62 62 } … … 64 64 { 65 65 my @out = $debugger->get_value('$q'); 66 cmp_deeply(\@out, [ 242, $D], '$q is 11*22=242');66 cmp_deeply(\@out, [$PROMPT, 242], '$q is 11*22=242'); 67 67 } 68 68 { 69 69 my @out = $debugger->get_value('$z'); 70 cmp_deeply(\@out, [ '', $D], '$z is empty');70 cmp_deeply(\@out, [$PROMPT, ''], '$z is empty'); 71 71 } 72 72 -
trunk/Debug-Client/t/02-sub-step_over.t
r9659 r9680 10 10 require Test::Deep; 11 11 import Test::Deep; 12 my $ D= re('\d+');12 my $PROMPT = re('\d+'); 13 13 14 14 plan(tests => 9); … … 33 33 { 34 34 my @out = $debugger->step_in; 35 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;', $D], 'line 6');35 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;'], 'line 6'); 36 36 } 37 37 { 38 38 my @out = $debugger->step_in; 39 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 7, 'my $y = 22;', $D], 'line 7');39 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 7, 'my $y = 22;'], 'line 7'); 40 40 } 41 41 42 42 { 43 43 my @out = $debugger->step_in; 44 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 8, 'my $q = f($x, $y);', $D], 'line 8')44 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 8, 'my $q = f($x, $y);'], 'line 8') 45 45 or diag($debugger->buffer); 46 46 } … … 48 48 { 49 49 my @out = $debugger->step_over; 50 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 9, 'my $z = $x + $y;', $D], 'line 9')50 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 9, 'my $z = $x + $y;'], 'line 9') 51 51 or diag($debugger->buffer); 52 52 } 53 53 { 54 54 my @out = $debugger->get_value('$q'); 55 cmp_deeply(\@out, [ 242, $D], '$q is 11*22=242')55 cmp_deeply(\@out, [$PROMPT, 242], '$q is 11*22=242') 56 56 or diag($debugger->buffer); 57 57 } 58 58 { 59 59 my @out = $debugger->get_value('$z'); 60 cmp_deeply(\@out, [ '', $D], '$z is empty');60 cmp_deeply(\@out, [$PROMPT, ''], '$z is empty'); 61 61 } 62 62 -
trunk/Debug-Client/t/02-sub.t
r9659 r9680 10 10 require Test::Deep; 11 11 import Test::Deep; 12 my $ D= re('\d+');12 my $PROMPT = re('\d+'); 13 13 14 14 plan(tests => 13); … … 33 33 { 34 34 my @out = $debugger->step_in; 35 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;', $D], 'line 6')35 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;'], 'line 6') 36 36 or diag($debugger->buffer); 37 37 } 38 38 { 39 39 my @out = $debugger->step_in; 40 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 7, 'my $y = 22;', $D], 'line 7')40 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 7, 'my $y = 22;'], 'line 7') 41 41 or diag($debugger->buffer); 42 42 } … … 44 44 { 45 45 my @out = $debugger->step_in; 46 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 8, 'my $q = f($x, $y);', $D], 'line 8')46 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 8, 'my $q = f($x, $y);'], 'line 8') 47 47 or diag($debugger->buffer); 48 48 } … … 50 50 { 51 51 my @out = $debugger->step_in; 52 cmp_deeply(\@out, [ 'main::f', 't/eg/02-sub.pl', 13, ' my ($q, $w) = @_;', $D], 'line 13')52 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 13, ' my ($q, $w) = @_;'], 'line 13') 53 53 or diag($debugger->buffer); 54 54 } … … 56 56 { 57 57 my @out = $debugger->step_in; 58 cmp_deeply(\@out, [ 'main::f', 't/eg/02-sub.pl', 14, ' my $multi = $q * $w;', $D], 'line 14')58 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 14, ' my $multi = $q * $w;'], 'line 14') 59 59 or diag($debugger->buffer); 60 60 } … … 62 62 { 63 63 my @out = $debugger->step_in; 64 cmp_deeply(\@out, [ 'main::f', 't/eg/02-sub.pl', 15, ' my $add = $q + $w;', $D], 'line 15')64 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 15, ' my $add = $q + $w;'], 'line 15') 65 65 or diag($debugger->buffer); 66 66 } … … 68 68 { 69 69 my @out = $debugger->step_in; 70 cmp_deeply(\@out, [ 'main::f', 't/eg/02-sub.pl', 16, ' return $multi;', $D], 'line 16')70 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 16, ' return $multi;'], 'line 16') 71 71 or diag($debugger->buffer); 72 72 } … … 74 74 { 75 75 my @out = $debugger->step_in; 76 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 9, 'my $z = $x + $y;', $D], 'line 9')76 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 9, 'my $z = $x + $y;'], 'line 9') 77 77 or diag($debugger->buffer); 78 78 } … … 80 80 { 81 81 my @out = $debugger->get_value('$q'); 82 cmp_deeply(\@out, [ 242, $D], '$q is 11*22=242')82 cmp_deeply(\@out, [$PROMPT, 242], '$q is 11*22=242') 83 83 or diag($debugger->buffer); 84 84 } 85 85 { 86 86 my @out = $debugger->get_value('$z'); 87 cmp_deeply(\@out, [ '', $D], '$z is empty')87 cmp_deeply(\@out, [$PROMPT, ''], '$z is empty') 88 88 or diag($debugger->buffer); 89 89 } -
trunk/Debug-Client/t/03-return.t
r9659 r9680 10 10 require Test::Deep; 11 11 import Test::Deep; 12 my $ D= re('\d+');12 my $PROMPT = re('\d+'); 13 13 14 14 plan(tests => 13); … … 33 33 { 34 34 my @out = $debugger->step_in; 35 cmp_deeply(\@out, [ 'main::', 't/eg/03-return.pl', 6, 'my $x = 11;', $D], 'line 6')35 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/03-return.pl', 6, 'my $x = 11;'], 'line 6') 36 36 or diag($debugger->buffer); 37 37 } 38 38 { 39 39 my @out = $debugger->step_in; 40 cmp_deeply(\@out, [ 'main::', 't/eg/03-return.pl', 7, 'my $q = f("foo\nbar");', $D], 'line 7')40 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/03-return.pl', 7, 'my $q = f("foo\nbar");'], 'line 7') 41 41 or diag($debugger->buffer); 42 42 } 43 43 { 44 44 my @out = $debugger->step_in; 45 cmp_deeply(\@out, [ 'main::f', 't/eg/03-return.pl', 16, ' my ($in) = @_;', $D], 'line 16')45 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/03-return.pl', 16, ' my ($in) = @_;'], 'line 16') 46 46 or diag($debugger->buffer); 47 47 } … … 49 49 { 50 50 my @out = $debugger->step_out; 51 cmp_deeply(\@out, [ 'main::', 't/eg/03-return.pl', 8, '$x++;', $D, "'foo\nbar'"], 'line 8')51 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/03-return.pl', 8, '$x++;', "'foo\nbar'"], 'line 8') 52 52 or diag($debugger->buffer); 53 53 } 54 54 { 55 55 my @out = $debugger->step_in; 56 cmp_deeply(\@out, [ 'main::', 't/eg/03-return.pl', 9, q{my @q = g('baz', "foo\nbar", 'moo');}, $D], 'line 9')56 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/03-return.pl', 9, q{my @q = g('baz', "foo\nbar", 'moo');}], 'line 9') 57 57 or diag($debugger->buffer); 58 58 } 59 59 { 60 60 my @out = $debugger->step_in; 61 cmp_deeply(\@out, [ 'main::g', 't/eg/03-return.pl', 22, ' my (@in) = @_;', $D], 'line 22')61 cmp_deeply(\@out, [$PROMPT, 'main::g', 't/eg/03-return.pl', 22, ' my (@in) = @_;'], 'line 22') 62 62 or diag($debugger->buffer); 63 63 } … … 70 70 2 'moo'); 71 71 72 cmp_deeply(\@out, [ 'main::', 't/eg/03-return.pl', 10, '$x++;', $D, $expected], 'line 10')72 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/03-return.pl', 10, '$x++;', $expected], 'line 10') 73 73 or diag($debugger->buffer); 74 74 } … … 76 76 { 77 77 my @out = $debugger->step_in; 78 cmp_deeply(\@out, [ 'main::', 't/eg/03-return.pl', 11, q{my %q = h(bar => "foo\nbar", moo => 42);}, $D], 'line 11')78 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/03-return.pl', 11, q{my %q = h(bar => "foo\nbar", moo => 42);}], 'line 11') 79 79 or diag($debugger->buffer); 80 80 } … … 82 82 { 83 83 my @out = $debugger->step_in; 84 cmp_deeply(\@out, [ 'main::h', 't/eg/03-return.pl', 28, ' my (%in) = @_;', $D], 'line 28')84 cmp_deeply(\@out, [$PROMPT, 'main::h', 't/eg/03-return.pl', 28, ' my (%in) = @_;'], 'line 28') 85 85 or diag($debugger->buffer); 86 86 } … … 91 91 # TODO check how to test the return data in this case as it looks like an array 92 92 93 cmp_deeply(\@out, [ 'main::', 't/eg/03-return.pl', 12, '$x++;', $D, ''], 'line 12')93 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/03-return.pl', 12, '$x++;', ''], 'line 12') 94 94 or diag($debugger->buffer); 95 95 } -
trunk/Debug-Client/t/04-run.t
r9659 r9680 11 11 require Test::Deep; 12 12 import Test::Deep; 13 my $ D= re('\d+');13 my $PROMPT = re('\d+'); 14 14 15 15 plan(tests => 4); … … 34 34 { 35 35 my @out = $debugger->step_in; 36 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;', $D], 'line 6')36 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;'], 'line 6') 37 37 or diag($debugger->buffer); 38 38 } -
trunk/Debug-Client/t/04-run_to_line.t
r9659 r9680 11 11 require Test::Deep; 12 12 import Test::Deep; 13 my $ D= re('\d+');13 my $PROMPT = re('\d+'); 14 14 15 15 plan(tests => 5); … … 35 35 { 36 36 my @out = $debugger->step_in; 37 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;', $D], 'line 6')37 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;'], 'line 6') 38 38 or diag($debugger->buffer); 39 39 } … … 41 41 { 42 42 my @out = $debugger->run(14); 43 cmp_deeply(\@out, [ 'main::f', 't/eg/02-sub.pl', 14, ' my $multi = $q * $w;', $D], 'line 14')43 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 14, ' my $multi = $q * $w;'], 'line 14') 44 44 or diag($debugger->buffer); 45 45 } -
trunk/Debug-Client/t/04-run_to_sub.t
r9659 r9680 11 11 require Test::Deep; 12 12 import Test::Deep; 13 my $ D= re('\d+');13 my $PROMPT = re('\d+'); 14 14 15 15 plan(tests => 5); … … 35 35 { 36 36 my @out = $debugger->step_in; 37 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;', $D], 'line 6')37 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;'], 'line 6') 38 38 or diag($debugger->buffer); 39 39 } … … 41 41 { 42 42 my @out = $debugger->run('f'); 43 cmp_deeply(\@out, [ 'main::f', 't/eg/02-sub.pl', 13, ' my ($q, $w) = @_;', $D], 'line 13')43 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 13, ' my ($q, $w) = @_;'], 'line 13') 44 44 or diag($debugger->buffer); 45 45 } -
trunk/Debug-Client/t/05-execute.t
r9676 r9680 10 10 require Test::Deep; 11 11 import Test::Deep; 12 my $ D= re('\d+');12 my $PROMPT = re('\d+'); 13 13 14 14 our $TODO; # needed becasue Test::More is required and not used … … 35 35 { 36 36 my @out = $debugger->step_in; 37 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;', $D], 'line 6')37 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 6, 'my $x = 11;'], 'line 6') 38 38 or diag($debugger->buffer); 39 39 } 40 40 { 41 41 my @out = $debugger->step_in; 42 cmp_deeply(\@out, [ 'main::', 't/eg/02-sub.pl', 7, 'my $y = 22;', $D], 'line 7')42 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 7, 'my $y = 22;'], 'line 7') 43 43 or diag($debugger->buffer); 44 44 } … … 46 46 { 47 47 my @out = $debugger->execute_code('$abc = 23'); 48 cmp_deeply(\@out, [ '', $D], 'execute 1')48 cmp_deeply(\@out, [$PROMPT, ''], 'execute 1') 49 49 or diag($debugger->buffer); 50 50 } 51 51 { 52 52 my @out = $debugger->get_value('$abc'); 53 cmp_deeply(\@out, [ 23, $D], 'execute 1')53 cmp_deeply(\@out, [$PROMPT, 23], 'execute 1') 54 54 or diag($debugger->buffer); 55 55 } 56 56 { 57 57 my @out = $debugger->execute_code('@qwe = (23, 42)'); 58 cmp_deeply(\@out, [ '', $D], 'execute 2')58 cmp_deeply(\@out, [$PROMPT, ''], 'execute 2') 59 59 or diag($debugger->buffer); 60 60 } … … 63 63 local $TODO = 'get_value of array'; 64 64 my @out = $debugger->get_value('@qwe'); 65 cmp_deeply(\@out, [ 23, 42, $D], 'get_value of array')65 cmp_deeply(\@out, [$PROMPT, 23, 42], 'get_value of array') 66 66 or diag($debugger->buffer); 67 67 } … … 69 69 { 70 70 my @out = $debugger->execute_code('%h = (fname => "foo", lname => "bar")'); 71 cmp_deeply(\@out, [ '', $D], 'execute 3')71 cmp_deeply(\@out, [$PROMPT, ''], 'execute 3') 72 72 or diag($debugger->buffer); 73 73 } … … 76 76 local $TODO = 'get_value of hash'; 77 77 my @out = $debugger->get_value('%h'); 78 cmp_deeply(\@out, [$ D], 'get_value of hash')78 cmp_deeply(\@out, [$PROMPT], 'get_value of hash') 79 79 or diag($debugger->buffer); 80 80 } … … 83 83 { 84 84 my @out = $debugger->set_breakpoint( 't/eg/02-sub.pl', 15 ); 85 cmp_deeply(\@out, [ '', $D], 'set_breakpoint')85 cmp_deeply(\@out, [$PROMPT, ''], 'set_breakpoint') 86 86 or diag($debugger->buffer); 87 87 } … … 89 89 { 90 90 my @out = $debugger->run; 91 cmp_deeply(\@out, [ 'main::f', 't/eg/02-sub.pl', 15, ' my $add = $q + $w;', $D], 'line 15')91 cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 15, ' my $add = $q + $w;'], 'line 15') 92 92 or diag($debugger->buffer); 93 93 } -
trunk/Debug-Client/t/06-breakpoint.t
r9659 r9680 10 10 require Test::Deep; 11 11 import Test::Deep; 12 my $ D= re('\d+');12 my $PROMPT = re('\d+'); 13 13 14 14 plan(tests => 6); … … 33 33 { 34 34 my @out = $debugger->step_in; 35 cmp_deeply(\@out, [ 'main::', 't/eg/03-return.pl', 6, 'my $x = 11;', $D], 'line 6')35 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/03-return.pl', 6, 'my $x = 11;'], 'line 6') 36 36 or diag($debugger->buffer); 37 37 } … … 39 39 { 40 40 my @out = $debugger->set_breakpoint('t/eg/03-return.pl', 'g'); 41 cmp_deeply(\@out, [ '', $D], 'set_breakpoint')41 cmp_deeply(\@out, [$PROMPT, ''], 'set_breakpoint') 42 42 or diag($debugger->buffer); 43 43 } … … 45 45 { 46 46 my @out = $debugger->run; 47 cmp_deeply(\@out, [ 'main::g', 't/eg/03-return.pl', 22, q{ my (@in) = @_;}, $D], 'line 9')47 cmp_deeply(\@out, [$PROMPT, 'main::g', 't/eg/03-return.pl', 22, q{ my (@in) = @_;}], 'line 9') 48 48 or diag($debugger->buffer); 49 49 } -
trunk/Debug-Client/t/07-quit.t
r9659 r9680 10 10 require Test::Deep; 11 11 import Test::Deep; 12 my $ D= re('\d+');12 my $PROMPT = re('\d+'); 13 13 14 14 plan(tests => 3); … … 33 33 { 34 34 my @out = $debugger->step_in; 35 cmp_deeply(\@out, [ 'main::', 't/eg/03-return.pl', 6, 'my $x = 11;', $D], 'line 6')35 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/03-return.pl', 6, 'my $x = 11;'], 'line 6') 36 36 or diag($debugger->buffer); 37 37 } -
trunk/Debug-Client/t/08-recursive.t
r9659 r9680 10 10 require Test::Deep; 11 11 import Test::Deep; 12 my $ D= re('\d+');12 my $PROMPT = re('\d+'); 13 13 14 14 plan(tests => 8); … … 33 33 { 34 34 my @out = $debugger->step_in; 35 cmp_deeply(\@out, [ 'main::', 't/eg/04-fib.pl', 22, 'my $res = fib(10);', $D], 'line 22')35 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/04-fib.pl', 22, 'my $res = fib(10);'], 'line 22') 36 36 or diag($debugger->buffer); 37 37 } … … 39 39 { 40 40 my @out = $debugger->set_breakpoint('t/eg/04-fib.pl', 'fibx'); 41 cmp_deeply(\@out, [ '', $D], 'set_breakpoint')41 cmp_deeply(\@out, [$PROMPT, ''], 'set_breakpoint') 42 42 or diag($debugger->buffer); 43 43 } … … 45 45 { 46 46 my @out = $debugger->run; 47 cmp_deeply(\@out, [ 'main::fibx', 't/eg/04-fib.pl', 17, ' my $n = shift;', $D], 'line 17')47 cmp_deeply(\@out, [$PROMPT, 'main::fibx', 't/eg/04-fib.pl', 17, ' my $n = shift;'], 'line 17') 48 48 or diag($debugger->buffer); 49 49 } … … 54 54 $ = main::fib(10) called from file `t/eg/04-fib.pl' line 22); 55 55 56 cmp_deeply(\@out, [$ trace, $D], 'stack trace')56 cmp_deeply(\@out, [$PROMPT, $trace], 'stack trace') 57 57 or diag($debugger->buffer); 58 58 } … … 60 60 { 61 61 my @out = $debugger->run(10); 62 cmp_deeply(\@out, [ 'main::fib', 't/eg/04-fib.pl', 10, ' return 0 if $n == 0;', $D], 'line 10')62 cmp_deeply(\@out, [$PROMPT, 'main::fib', 't/eg/04-fib.pl', 10, ' return 0 if $n == 0;'], 'line 10') 63 63 or diag($debugger->buffer); 64 64 } … … 70 70 $ = main::fib(10) called from file `t/eg/04-fib.pl' line 22); 71 71 72 cmp_deeply(\@out, [$ trace, $D], 'stack trace')72 cmp_deeply(\@out, [$PROMPT, $trace], 'stack trace') 73 73 or diag($debugger->buffer); 74 74 } -
trunk/Debug-Client/t/09-io.t
r9671 r9680 15 15 require Test::Deep; 16 16 import Test::Deep; 17 my $ D= re('\d+');17 my $PROMPT = re('\d+'); 18 18 19 19 plan(tests => 23); … … 40 40 { 41 41 my @out = $debugger->step_in; 42 cmp_deeply(\@out, [ 'main::', 't/eg/05-io.pl', 6, 'print "One\n";', $D], 'line 6')42 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/05-io.pl', 6, 'print "One\n";'], 'line 6') 43 43 or diag($debugger->buffer); 44 44 } … … 46 46 { 47 47 my @out = $debugger->step_in; 48 cmp_deeply(\@out, [ 'main::', 't/eg/05-io.pl', 7, 'print STDERR "Two\n";', $D], 'line 7')48 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/05-io.pl', 7, 'print STDERR "Two\n";'], 'line 7') 49 49 or diag($debugger->buffer); 50 50 } … … 59 59 { 60 60 my @out = $debugger->step_in; 61 cmp_deeply(\@out, [ 'main::', 't/eg/05-io.pl', 8, 'print "Three\n";', $D], 'line 8')61 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/05-io.pl', 8, 'print "Three\n";'], 'line 8') 62 62 or diag($debugger->buffer); 63 63 } … … 72 72 { 73 73 my @out = $debugger->step_in; 74 cmp_deeply(\@out, [ 'main::', 't/eg/05-io.pl', 9, 'print "Four";', $D], 'line 9')74 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/05-io.pl', 9, 'print "Four";'], 'line 9') 75 75 or diag($debugger->buffer); 76 76 } … … 87 87 { 88 88 my @out = $debugger->step_in; 89 cmp_deeply(\@out, [ 'main::', 't/eg/05-io.pl', 10, 'print "\n";', $D], 'line 10')89 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/05-io.pl', 10, 'print "\n";'], 'line 10') 90 90 or diag($debugger->buffer); 91 91 } … … 100 100 { 101 101 my @out = $debugger->step_in; 102 cmp_deeply(\@out, [ 'main::', 't/eg/05-io.pl', 11, 'print STDERR "Five";', $D], 'line 11')102 cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/05-io.pl', 11, 'print STDERR "Five";'], 'line 11') 103 103 or diag($debugger->buffer); 104 104 }
Note: See TracChangeset
for help on using the changeset viewer.
