93734215e33979383aa0e4adee0190a789357841
[p5sagit/Devel-Declare.git] / t / debug.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5
6 BEGIN {
7   if($] eq "5.011002") {
8     plan skip_all => "line debugging broken on 5.11.2";
9   }
10 }
11
12 use Cwd qw/cwd/;
13 use FindBin qw/$Bin/;
14
15 $ENV{PERLDB_OPTS} = "NonStop";
16 $ENV{DD_DEBUG} = 1;
17 cwd("$Bin/..");
18
19 # Write a .perldb file so we make sure we dont use the users one
20 open PERLDB, ">", "$Bin/../.perldb" or die "Cannot open $Bin/../.perldb: $!";
21 close PERLDB;
22
23 $SIG{CHLD} = 'IGNORE';
24 $SIG{ALRM} = sub {
25   fail("SIGALRM timeout triggered");
26   kill(9, $$);
27 };
28
29 alarm 10;
30 my $output = `$^X -d t/debug.pl`;
31
32 like($output, qr/method new {}, sub {my \$self = shift;/,
33   "replaced line string visible in debug lines");
34
35 done_testing;