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