File: source.t

package info (click to toggle)
libdevel-confess-perl 0.009003-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 212 kB
  • ctags: 57
  • sloc: perl: 985; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 467 bytes parent folder | download | duplicates (4)
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
use strict;
use warnings;
BEGIN {
  $ENV{DEVEL_CONFESS_OPTIONS} = '';
}
use Test::More tests => 3;

use Devel::Confess qw(source);

my $file = __FILE__;
my @lines;

sub Foo::foo {
  push @lines, __LINE__; die "error";
}

sub Bar::bar {
  push @lines, __LINE__; Foo::foo(@_);
}

sub Baz::baz {
  push @lines, __LINE__; Bar::bar(@_);
}

eval { Baz::baz([1]) };

for my $line (@lines) {
  ok $@ =~ /context for \Q$file\E line $line:/, 'trace includes required line';
}