avoid "insecure rcfile" warning from test
[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
e4e34af3 20umask 077;
7dd7d008 21open PERLDB, ">", "$Bin/../.perldb" or die "Cannot open $Bin/../.perldb: $!";
22close PERLDB;
23
24$SIG{CHLD} = 'IGNORE';
87195072 25$SIG{ALRM} = sub {
7dd7d008 26 fail("SIGALRM timeout triggered");
27 kill(9, $$);
28};
29
30alarm 10;
31my $output = `$^X -d t/debug.pl`;
32
33like($output, qr/method new {}, sub {my \$self = shift;/,
34 "replaced line string visible in debug lines");
023db2fb 35
36done_testing;