fix Test::More prereq for done_testing
[p5sagit/Devel-Declare.git] / t / debug.t
1 use strict;
2 use warnings;
3
4 use Test::More 0.88;
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 umask 077;
21 open PERLDB, ">", "$Bin/../.perldb" or die "Cannot open $Bin/../.perldb: $!";
22 close PERLDB;
23
24 $SIG{CHLD} = 'IGNORE';
25 $SIG{ALRM} = sub {
26   fail("SIGALRM timeout triggered");
27   kill(9, $$);
28 };
29
30 alarm 10;
31 my $output = `$^X -d t/debug.pl`;
32
33 like($output, qr/method new \{\}, sub \{my \$self = shift;/,
34   "replaced line string visible in debug lines");
35
36 done_testing;