File: universal.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 (33 lines) | stat: -rw-r--r-- 655 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
31
32
33
use strict;
use warnings;
BEGIN {
  $ENV{DEVEL_CONFESS_OPTIONS} = '';
}
use Test::More ($ENV{RELEASE_TESTING} || eval {
  require UNIVERSAL::isa;
  require UNIVERSAL::can;
}) ? (tests => 1)
  : (skip_all => 'UNIVERSAL::can and UNIVERSAL::isa required for this test');
use Carp ();
use Carp::Heavy ();

use Devel::Confess qw(nowarnings);

{
  package Thing1;
  sub isa { UNIVERSAL::isa(@_) }
  sub can { UNIVERSAL::can(@_) }
}

my @warnings;
my $o = bless {}, 'Thing1';
local $SIG{__WARN__} = sub { push @warnings, $_[0] };
eval {
  die $o;
};
eval {
  die $o;
};

is join('', @warnings), '',
  "no warnings produced from error class with overridden can";