File: debug.t

package info (click to toggle)
libdevel-declare-perl 0.006017-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-updates
  • size: 428 kB
  • ctags: 249
  • sloc: ansic: 752; perl: 608; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use strict;
use warnings;

use Test::More;

BEGIN {
  if($] eq "5.011002") {
    plan skip_all => "line debugging broken on 5.11.2";
  }
}

use Cwd qw/cwd/;
use FindBin qw/$Bin/;

$ENV{PERLDB_OPTS} = "NonStop";
$ENV{DD_DEBUG} = 1;
cwd("$Bin/..");

# Write a .perldb file so we make sure we dont use the users one
umask 077;
open PERLDB, ">", "$Bin/../.perldb" or die "Cannot open $Bin/../.perldb: $!";
close PERLDB;

$SIG{CHLD} = 'IGNORE';
$SIG{ALRM} = sub {
  fail("SIGALRM timeout triggered");
  kill(9, $$);
};

alarm 10;
my $output = `$^X -d t/debug.pl`;

like($output, qr/method new \{\}, sub \{my \$self = shift;/,
  "replaced line string visible in debug lines");

done_testing;