14 if (! -c "/dev/null") {
15 print "1..0 # Skip: no /dev/null\n";
19 my $dev_tty = '/dev/tty';
20 $dev_tty = 'TT:' if ($^O eq 'VMS');
22 print "1..0 # Skip: no $dev_tty\n";
26 print "1..0 # Skip: \$ENV{PERL5DB} is already set to '$ENV{PERL5DB}'\n";
33 my $rc_filename = '.perldb';
36 open my $rc_fh, '>', $rc_filename
41 # overly permissive perms gives "Must not source insecure rcfile"
42 # and hangs at the DB(1> prompt
43 chmod 0644, $rc_filename;
50 open my $in, '<', $filename
51 or die "Cannot open '$filename' for slurping - $!";
61 my $out_fn = 'db.out';
65 return _slurp($out_fn);
71 &parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
78 'x "new_var = <\$new_var>\\n";',
88 local $ENV{PERLDB_OPTS};
91 &parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
102 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-61222');
103 unlike(_out_contents(), qr/INCORRECT/, "[perl #61222]");
108 # Test for Proxy constants
113 &parse_options("NonStop=0 ReadLine=0 TTY=db.out LineInfo=db.out");
125 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/proxy-constants');
126 is($output, "", "proxy constant subroutines");
129 # [perl #66110] Call a subroutine inside a regex
131 local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
132 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-66110');
133 like($output, "All tests successful.", "[perl #66110]");
136 # [perl 104168] level option for tracing
139 &parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
142 push (@DB::typeahead,
151 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-104168');
152 my $contents = _out_contents();
153 like($contents, qr/level 2/, "[perl #104168]");
154 unlike($contents, qr/baz/, "[perl #104168]");
160 local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
161 my $output = runperl(switches => [ '-d', '-T' ], stderr => 1,
162 progfile => '../lib/perl5db/t/taint');
163 chomp $output if $^O eq 'VMS'; # newline guaranteed at EOF
164 is($output, '[$^X][done]', "taint");
172 my $self = bless {}, $class;
183 $self->{_cmds} = shift;
186 return $self->{_cmds};
193 $self->{_prog} = shift;
196 return $self->{_prog};
203 $self->{_output} = shift;
206 return $self->{_output};
215 $self->{_include_t} = shift;
218 return $self->{_include_t};
227 $self->{_stderr_val} = shift;
230 return $self->{_stderr_val};
239 $self->{field} = shift;
242 return $self->{field};
251 $self->{_switches} = shift;
254 return $self->{_switches};
263 $self->{_contents} = shift;
266 return $self->{_contents};
271 my ($self, $args) = @_;
273 my $cmds = $args->{cmds};
275 if (ref($cmds) ne 'ARRAY') {
276 die "cmds must be an array of commands.";
281 my $prog = $args->{prog};
283 if (ref($prog) ne '' or !defined($prog)) {
284 die "prog should be a path to a program file.";
289 $self->_include_t($args->{include_t} ? 1 : 0);
291 $self->_stderr_val(exists($args->{stderr}) ? $args->{stderr} : 1);
293 if (exists($args->{switches}))
295 $self->_switches($args->{switches});
305 my ($self, $str) = @_;
307 $str =~ s/(["\@\$\\])/\\$1/g;
317 my $rc = qq{&parse_options("NonStop=0 TTY=db.out LineInfo=db.out");\n};
322 q#push (@DB::typeahead,#,
323 (map { $self->_quote($_) . "," } @{$self->_cmds()}),
329 # I guess two objects like that cannot be used at the same time.
337 ($self->_switches ? (@{$self->_switches()}) : ('-d')),
338 ($self->_include_t ? ('-I', '../lib/perl5db/t') : ())
340 (defined($self->_stderr_val())
341 ? (stderr => $self->_stderr_val())
344 progfile => $self->_prog()
347 $self->_output($output);
349 $self->_contents(::_out_contents());
355 my ($self, $re, $msg) = @_;
357 local $::Level = $::Level + 1;
358 ::like($self->_output(), $re, $msg);
362 my ($self, $re, $msg) = @_;
364 local $::Level = $::Level + 1;
365 ::unlike($self->_output(), $re, $msg);
369 my ($self, $re, $msg) = @_;
371 local $::Level = $::Level + 1;
372 ::like($self->_contents(), $re, $msg);
375 sub contents_unlike {
376 my ($self, $re, $msg) = @_;
378 local $::Level = $::Level + 1;
379 ::unlike($self->_contents(), $re, $msg);
385 local $ENV{PERLDB_OPTS} = "ReadLine=0";
386 my $target = '../lib/perl5db/t/eval-line-bug';
387 my $wrapper = DebugWrap->new(
397 "p \@{'main::_<$target'}",
403 $wrapper->contents_like(
405 'The ${main::_<filename} variable in the debugger was not destroyed',
409 sub _calc_new_var_wrapper
413 my $extra_opts = delete($args->{extra_opts});
415 local $ENV{PERLDB_OPTS} = "ReadLine=0" . $extra_opts;
416 return DebugWrap->new(
423 'x "new_var = <$new_var>\\n"',
426 prog => delete($args->{prog}),
433 _calc_new_var_wrapper({ prog => '../lib/perl5db/t/eval-line-bug'})
436 "no strict 'vars' in evaluated lines.",
441 _calc_new_var_wrapper(
443 prog => '../lib/perl5db/t/lvalue-bug',
448 'lvalue subs work in the debugger',
453 _calc_new_var_wrapper(
455 prog => '../lib/perl5db/t/symbol-table-bug',
456 extra_opts => "NonStop=1",
460 qr/Undefined symbols 0/,
461 'there are no undefined values in the symbol table',
467 if ( $Config{usethreads} ) {
468 skip('This perl has threads, skipping non-threaded debugger tests');
471 my $error = 'This Perl not built to support threads';
472 _calc_new_var_wrapper(
474 prog => '../lib/perl5db/t/eval-line-bug',
475 switches => ['-dt',],
480 'Perl debugger correctly complains that it was not built with threads',
487 if ( $Config{usethreads} ) {
488 _calc_new_var_wrapper(
490 prog => '../lib/perl5db/t/symbol-table-bug',
491 switches => [ '-dt', ],
495 qr/Undefined symbols 0/,
496 'there are no undefined values in the symbol table when running with thread support',
500 skip("This perl is not threaded, skipping threaded debugger tests");
504 # Testing that we can set a line in the middle of the file.
506 my $wrapper = DebugWrap->new(
510 'b ../lib/perl5db/t/MyModule.pm:12',
512 q/do { use IO::Handle; STDOUT->autoflush(1); print "Var=$var\n"; }/,
517 prog => '../lib/perl5db/t/filename-line-breakpoint'
521 $wrapper->output_like(qr/
529 "Can set breakpoint in a line in the middle of the file.");
532 # Testing that we can set a breakpoint
534 my $wrapper = DebugWrap->new(
536 prog => '../lib/perl5db/t/breakpoint-bug',
541 q/do { use IO::Handle; STDOUT->autoflush(1); print "X={$x}\n"; }/,
548 $wrapper->output_like(
550 "Can set breakpoint in a line."
554 # Testing that we can disable a breakpoint at a numeric line.
556 my $wrapper = DebugWrap->new(
558 prog => '../lib/perl5db/t/disable-breakpoints-1',
565 q/print "X={$x}\n";/,
572 $wrapper->output_like(qr/X=\{SecondVal\}/ms,
573 "Can set breakpoint in a line.");
576 # Testing that we can re-enable a breakpoint at a numeric line.
578 my $wrapper = DebugWrap->new(
580 prog => '../lib/perl5db/t/disable-breakpoints-2',
589 q/print "X={$x}\n";/,
596 $wrapper->output_like(
598 X=\{SecondValOneHundred\}
600 "Can set breakpoint in a line."
605 # Disable and enable for breakpoints on outer files.
607 my $wrapper = DebugWrap->new(
612 'b ../lib/perl5db/t/EnableModule.pm:14',
613 'disable ../lib/perl5db/t/EnableModule.pm:14',
615 'enable ../lib/perl5db/t/EnableModule.pm:14',
617 q/print "X={$x}\n";/,
621 prog => '../lib/perl5db/t/disable-breakpoints-3',
626 $wrapper->output_like(qr/
627 X=\{SecondValTwoHundred\}
629 "Can set breakpoint in a line.");
632 # Testing that the prompt with the information appears.
634 my $wrapper = DebugWrap->new(
637 prog => '../lib/perl5db/t/disable-breakpoints-1',
641 $wrapper->contents_like(qr/
642 ^main::\([^\)]*\bdisable-breakpoints-1:2\):\n
643 2:\s+my\ \$x\ =\ "One";\n
645 "Prompt should display the first line of code.");
648 # Testing that R (restart) and "B *" work.
650 my $wrapper = DebugWrap->new(
660 q/print "X={$x};dummy={$dummy}\n";/,
663 prog => '../lib/perl5db/t/disable-breakpoints-1',
667 $wrapper->output_like(qr/
668 X=\{FirstVal\};dummy=\{1\}
670 "Restart and delete all breakpoints work properly.");
674 my $wrapper = DebugWrap->new(
679 q/print "X={$x}\n";/,
683 prog => '../lib/perl5db/t/disable-breakpoints-1',
687 $wrapper->output_like(qr/
690 "'c line_num' is working properly.");
694 my $wrapper = DebugWrap->new(
702 q/print "Exp={$exp}\n";/,
705 prog => '../lib/perl5db/t/break-on-dot',
709 $wrapper->output_like(qr/
712 "'b .' is working correctly.");
715 # Testing that the prompt with the information appears inside a subroutine call.
716 # See https://rt.perl.org/rt3/Ticket/Display.html?id=104820
718 my $wrapper = DebugWrap->new(
725 prog => '../lib/perl5db/t/with-subroutine',
729 $wrapper->contents_like(
731 ^main::back\([^\)\n]*\bwith-subroutine:15\):[\ \t]*\n
732 ^15:\s*print\ "hello\ back\\n";
734 "Prompt should display the line of code inside a subroutine.");
737 # Checking that the p command works.
739 my $wrapper = DebugWrap->new(
743 'p "<<<" . (4*6) . ">>>"',
746 prog => '../lib/perl5db/t/with-subroutine',
750 $wrapper->contents_like(
757 my $wrapper = DebugWrap->new(
764 prog => '../lib/perl5db/t/with-subroutine',
768 $wrapper->contents_like(
769 # qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/,
770 qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/ms,
775 # Tests for "T" (stack trace).
777 my $prog_fn = '../lib/perl5db/t/rt-104168';
778 my $wrapper = DebugWrap->new(
789 my $re_text = join('',
792 "%s = %s\\(\\) called from file " .
793 "'" . quotemeta($prog_fn) . "' line %s\\n",
794 (map { quotemeta($_) } @$_)
798 ['.', 'main::baz', 14,],
799 ['.', 'main::bar', 9,],
800 ['.', 'main::foo', 6],
803 $wrapper->contents_like(
804 # qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/,
812 my $wrapper = DebugWrap->new(
819 q/print "X={$x};dummy={$dummy}\n";/,
822 prog => '../lib/perl5db/t/disable-breakpoints-1'
826 $wrapper->output_like(qr/
827 X=\{SecondVal\};dummy=\{1\}
829 'test for s - single step',
834 my $wrapper = DebugWrap->new(
842 q/print "Exp={$exp}\n";/,
845 prog => '../lib/perl5db/t/break-on-dot'
849 $wrapper->output_like(qr/
852 "'b .' is working correctly.");
856 my $prog_fn = '../lib/perl5db/t/rt-104168';
857 my $wrapper = DebugWrap->new(
868 $wrapper->contents_like(
870 ^main::foo\([^\)\n]*\brt-104168:9\):[\ \t]*\n
873 'Test for the s command.',
878 my $wrapper = DebugWrap->new(
882 's uncalled_subroutine()',
887 prog => '../lib/perl5db/t/uncalled-subroutine'}
890 $wrapper->output_like(
892 'uncalled_subroutine was called after s EXPR()',
897 my $wrapper = DebugWrap->new(
901 'n uncalled_subroutine()',
905 prog => '../lib/perl5db/t/uncalled-subroutine',
909 $wrapper->output_like(
911 'uncalled_subroutine was called after n EXPR()',
916 my $wrapper = DebugWrap->new(
928 prog => '../lib/perl5db/t/fact',
932 $wrapper->output_like(
934 'b subroutine works fine',
938 # Test for 'M' (module list).
940 my $wrapper = DebugWrap->new(
947 prog => '../lib/perl5db/t/load-modules'
951 $wrapper->contents_like(
953 'M (module list) works fine',
958 my $wrapper = DebugWrap->new(
966 'print "Var=$var\n";',
969 prog => '../lib/perl5db/t/test-r-statement',
973 $wrapper->output_like(
981 'r statement is working properly.',
986 my $wrapper = DebugWrap->new(
993 prog => '../lib/perl5db/t/test-l-statement-1',
997 $wrapper->contents_like(
1000 2:\s+print\ "1\\n";\n
1003 5:\s+print\ "2\\n";\n
1005 'l statement is working properly (test No. 1).',
1010 my $wrapper = DebugWrap->new(
1022 prog => '../lib/perl5db/t/test-l-statement-1',
1026 my $first_l_out = qr/
1028 2:\s+print\ "1\\n";\n
1031 5:\s+print\ "2\\n";\n
1034 8:\s+print\ "3\\n";\n
1039 my $second_l_out = qr/
1040 11:\s+print\ "4\\n";\n
1043 14:\s+print\ "5\\n";\n
1046 17:\s+print\ "6\\n";\n
1049 20:\s+print\ "7\\n";\n
1051 $wrapper->contents_like(
1054 [^\n]*?DB<\d+>\ \#\ After\ l\ 1\n
1056 [^\n]*?DB<\d+>\ l\s*\n
1058 [^\n]*?DB<\d+>\ \#\ After\ l\ 2\n
1060 [^\n]*?DB<\d+>\ -\s*\n
1062 [^\n]*?DB<\d+>\ \#\ After\ -\n
1064 'l followed by l and then followed by -',
1069 my $wrapper = DebugWrap->new(
1076 prog => '../lib/perl5db/t/test-l-statement-2',
1080 my $first_l_out = qr/
1082 7:\s+my\ \$n\ =\ shift;\n
1083 8:\s+if\ \(\$n\ >\ 1\)\ \{\n
1084 9:\s+return\ \$n\ \*\ fact\(\$n\ -\ 1\);
1087 $wrapper->contents_like(
1092 'l subroutine_name',
1097 my $wrapper = DebugWrap->new(
1103 # Repeat several times to avoid @typeahead problems.
1110 prog => '../lib/perl5db/t/test-l-statement-2',
1115 ^main::fact\([^\n]*?:7\):\n
1116 ^7:\s+my\ \$n\ =\ shift;\n
1119 $wrapper->contents_like(
1124 'Test the "." command',
1128 # Testing that the f command works.
1130 my $wrapper = DebugWrap->new(
1134 'f ../lib/perl5db/t/MyModule.pm',
1137 q/do { use IO::Handle; STDOUT->autoflush(1); print "Var=$var\n"; }/,
1142 prog => '../lib/perl5db/t/filename-line-breakpoint'
1146 $wrapper->output_like(qr/
1154 "f command is working.",
1158 # We broke the /pattern/ command because apparently the CORE::eval-s inside
1159 # lib/perl5db.pl cannot handle lexical variable properly. So we now fix this
1164 # 1. Go over the rest of the "eval"s in lib/perl5db.t and see if they cause
1167 my $wrapper = DebugWrap->new(
1174 prog => '../lib/perl5db/t/eval-line-bug',
1178 $wrapper->contents_like(
1179 qr/12: \s* for\ my\ \$q\ \(1\ \.\.\ 10\)\ \{/msx,
1180 "/pat/ command is working and found a match.",
1185 my $wrapper = DebugWrap->new(
1194 prog => '../lib/perl5db/t/eval-line-bug',
1198 $wrapper->contents_like(
1199 qr/12: \s* for\ my\ \$q\ \(1\ \.\.\ 10\)\ \{/msx,
1200 "?pat? command is working and found a match.",
1204 # Test the L command.
1206 my $wrapper = DebugWrap->new(
1215 prog => '../lib/perl5db/t/eval-line-bug',
1219 $wrapper->contents_like(
1221 ^\S*?eval-line-bug:\n
1222 \s*6:\s*my\ \$i\ =\ 5;\n
1223 \s*break\ if\ \(1\)\n
1224 \s*13:\s*\$i\ \+=\ \$q;\n
1225 \s*break\ if\ \(\(\$q\ ==\ 5\)\)\n
1227 "L command is listing breakpoints",
1231 # Test the L command for watch expressions.
1233 my $wrapper = DebugWrap->new(
1241 prog => '../lib/perl5db/t/eval-line-bug',
1245 $wrapper->contents_like(
1247 ^Watch-expressions:\n
1250 "L command is listing watch expressions",
1255 my $wrapper = DebugWrap->new(
1265 prog => '../lib/perl5db/t/eval-line-bug',
1269 $wrapper->contents_like(
1271 ^Watch-expressions:\n
1275 "L command is not listing deleted watch expressions",
1279 # Test the L command.
1281 my $wrapper = DebugWrap->new(
1290 prog => '../lib/perl5db/t/eval-line-bug',
1294 $wrapper->contents_like(
1296 ^\S*?eval-line-bug:\n
1297 \s*6:\s*my\ \$i\ =\ 5;\n
1298 \s*break\ if\ \(1\)\n
1299 \s*13:\s*\$i\ \+=\ \$q;\n
1300 \s*action:\s+print\ \$i\n
1302 "L command is listing actions and breakpoints",
1307 my $wrapper = DebugWrap->new(
1314 prog => '../lib/perl5db/t/rt-104168',
1318 $wrapper->contents_like(
1329 my $wrapper = DebugWrap->new(
1336 prog => '../lib/perl5db/t/rt-104168',
1340 $wrapper->contents_like(
1346 "S command with regex",
1351 my $wrapper = DebugWrap->new(
1358 prog => '../lib/perl5db/t/rt-104168',
1362 $wrapper->contents_unlike(
1366 "S command with negative regex",
1369 $wrapper->contents_like(
1373 "S command with negative regex - what it still matches",
1377 # Test the a command.
1379 my $wrapper = DebugWrap->new(
1383 'a 13 print "\nVar<Q>=$q\n"',
1387 prog => '../lib/perl5db/t/eval-line-bug',
1391 $wrapper->output_like(qr#
1396 "a command is working",
1400 # Test the 'A' command
1402 my $wrapper = DebugWrap->new(
1406 'a 13 print "\nVar<Q>=$q\n"',
1411 prog => '../lib/perl5db/t/eval-line-bug',
1415 $wrapper->output_like(
1416 qr#\A\z#msx, # The empty string.
1417 "A command (for removing actions) is working",
1421 # Test the 'A *' command
1423 my $wrapper = DebugWrap->new(
1427 'a 6 print "\nFail!\n"',
1428 'a 13 print "\nVar<Q>=$q\n"',
1433 prog => '../lib/perl5db/t/eval-line-bug',
1437 $wrapper->output_like(
1438 qr#\A\z#msx, # The empty string.
1439 "'A *' command (for removing all actions) is working",
1444 my $wrapper = DebugWrap->new(
1451 'print "\nIDX=<$idx>\n"',
1454 prog => '../lib/perl5db/t/test-w-statement-1',
1459 $wrapper->contents_like(qr#
1461 \s+old\ value:\s+'1'\n
1462 \s+new\ value:\s+'2'\n
1464 'w command - watchpoint changed',
1466 $wrapper->output_like(qr#
1469 "w command - correct output from IDX",
1474 my $wrapper = DebugWrap->new(
1482 'print "\nIDX=<$idx>\n"',
1485 prog => '../lib/perl5db/t/test-w-statement-1',
1489 $wrapper->contents_unlike(qr#
1492 'W command - watchpoint was deleted',
1495 $wrapper->output_like(qr#
1498 "W command - stopped at end.",
1502 # Test the W * command.
1504 my $wrapper = DebugWrap->new(
1513 'print "\nIDX=<$idx>\n"',
1516 prog => '../lib/perl5db/t/test-w-statement-1',
1520 $wrapper->contents_unlike(qr#
1523 '"W *" command - watchpoint was deleted',
1526 $wrapper->output_like(qr#
1529 '"W *" command - stopped at end.',
1533 # Test the 'o' command (without further arguments).
1535 my $wrapper = DebugWrap->new(
1542 prog => '../lib/perl5db/t/test-w-statement-1',
1546 $wrapper->contents_like(qr#
1547 ^\s*warnLevel\ =\ '1'\n
1549 q#"o" command (without arguments) displays warnLevel#,
1552 $wrapper->contents_like(qr#
1553 ^\s*signalLevel\ =\ '1'\n
1555 q#"o" command (without arguments) displays signalLevel#,
1558 $wrapper->contents_like(qr#
1559 ^\s*dieLevel\ =\ '1'\n
1561 q#"o" command (without arguments) displays dieLevel#,
1564 $wrapper->contents_like(qr#
1565 ^\s*hashDepth\ =\ 'N/A'\n
1567 q#"o" command (without arguments) displays hashDepth#,
1571 # Test the 'o' query command.
1573 my $wrapper = DebugWrap->new(
1577 'o hashDepth? signalLevel?',
1580 prog => '../lib/perl5db/t/test-w-statement-1',
1584 $wrapper->contents_unlike(qr#warnLevel#,
1585 q#"o" query command does not display warnLevel#,
1588 $wrapper->contents_like(qr#
1589 ^\s*signalLevel\ =\ '1'\n
1591 q#"o" query command displays signalLevel#,
1594 $wrapper->contents_unlike(qr#dieLevel#,
1595 q#"o" query command does not display dieLevel#,
1598 $wrapper->contents_like(qr#
1599 ^\s*hashDepth\ =\ 'N/A'\n
1601 q#"o" query command displays hashDepth#,
1605 # Test the 'o' set command.
1607 my $wrapper = DebugWrap->new(
1615 prog => '../lib/perl5db/t/test-w-statement-1',
1619 $wrapper->contents_like(qr/
1620 ^\s*(signalLevel\ =\ '0'\n)
1624 q#o set command works#,
1627 $wrapper->contents_like(qr#
1628 ^\s*hashDepth\ =\ 'N/A'\n
1630 q#o set command - hashDepth#,
1634 # Test the '<' and "< ?" commands.
1636 my $wrapper = DebugWrap->new(
1640 q/< print "\nX=<$x>\n"/,
1646 prog => '../lib/perl5db/t/disable-breakpoints-1',
1650 $wrapper->contents_like(qr/
1651 ^pre-perl\ commands:\n
1652 \s*<\ --\ print\ "\\nX=<\$x>\\n"\n
1654 q#Test < and < ? commands - contents.#,
1657 $wrapper->output_like(qr#
1660 q#Test < and < ? commands - output.#,
1664 # Test the '< *' command.
1666 my $wrapper = DebugWrap->new(
1670 q/< print "\nX=<$x>\n"/,
1676 prog => '../lib/perl5db/t/disable-breakpoints-1',
1680 $wrapper->output_unlike(qr/FirstVal/,
1681 q#Test the '< *' command.#,
1685 # Test the '>' and "> ?" commands.
1687 my $wrapper = DebugWrap->new(
1692 q/> print "\nFOO=<$::foo>\n"/,
1698 prog => '../lib/perl5db/t/disable-breakpoints-1',
1702 $wrapper->contents_like(qr/
1703 ^post-perl\ commands:\n
1704 \s*>\ --\ print\ "\\nFOO=<\$::foo>\\n"\n
1706 q#Test > and > ? commands - contents.#,
1709 $wrapper->output_like(qr#
1712 q#Test > and > ? commands - output.#,
1716 # Test the '> *' command.
1718 my $wrapper = DebugWrap->new(
1722 q/> print "\nFOO=<$::foo>\n"/,
1728 prog => '../lib/perl5db/t/disable-breakpoints-1',
1732 $wrapper->output_unlike(qr/FOO=/,
1733 q#Test the '> *' command.#,
1737 # Test the < and > commands together
1739 my $wrapper = DebugWrap->new(
1744 q/< $::lorem += 10;/,
1745 q/> print "\nLOREM=<$::lorem>\n"/,
1752 prog => '../lib/perl5db/t/disable-breakpoints-1',
1756 $wrapper->output_like(qr#
1759 q#Test < and > commands. #,
1763 # Test the { ? and { [command] commands.
1765 my $wrapper = DebugWrap->new(
1776 prog => '../lib/perl5db/t/disable-breakpoints-1',
1780 $wrapper->contents_like(qr#
1781 ^No\ pre-debugger\ actions\.\n
1783 ^pre-debugger\ commands:\n
1786 ^5==>b\s+\$x\ =\ "FirstVal";\n
1790 9:\s+\$x\ =\ "SecondVal";\n
1793 'Test the pre-prompt debugger commands',
1797 # Test the { * command.
1799 my $wrapper = DebugWrap->new(
1807 q/print (("One" x 5), "\n");/,
1810 prog => '../lib/perl5db/t/disable-breakpoints-1',
1814 $wrapper->contents_like(qr#
1815 ^All\ \{\ actions\ cleared\.\n
1817 'Test the { * command',
1820 $wrapper->output_like(qr/OneOneOneOneOne/,
1821 '{ * test - output is OK.',
1825 # Test the ! command.
1827 my $wrapper = DebugWrap->new(
1835 prog => '../lib/perl5db/t/disable-breakpoints-1',
1839 $wrapper->contents_like(qr#
1840 (^3:\s+my\ \$dummy\ =\ 0;\n
1842 5:\s+\$x\ =\ "FirstVal";)\n
1847 'Test the ! command (along with l 3-5)',
1851 # Test the ! -number command.
1853 my $wrapper = DebugWrap->new(
1862 prog => '../lib/perl5db/t/disable-breakpoints-1',
1866 $wrapper->contents_like(qr#
1867 (^3:\s+my\ \$dummy\ =\ 0;\n
1869 5:\s+\$x\ =\ "FirstVal";)\n
1871 ^2==\>\s+my\ \$x\ =\ "One";\n
1876 'Test the ! -n command (along with l)',
1881 1 while unlink ($rc_filename, $out_fn);