/usr/share/perl5/Test/NoWarnings/Warning.pm is in libtest-nowarnings-perl 1.04-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | package Test::NoWarnings::Warning;
use 5.006;
use strict;
use Carp ();
use vars qw{$VERSION};
BEGIN {
$VERSION = '1.04';
# Optional stacktrace support
eval "require Devel::StackTrace";
}
sub new {
my $class = shift;
bless { @_ }, $class;
}
sub getTrace {
$_[0]->{Trace};
}
sub fillTrace {
my $self = shift;
$self->{Trace} = Devel::StackTrace->new(
ignore_class => [__PACKAGE__, @_],
) if $Devel::StackTrace::VERSION;
}
sub getCarp {
$_[0]->{Carp};
}
sub fillCarp {
my $self = shift;
my $msg = shift;
$Carp::Internal{ __PACKAGE__ . "" }++;
local $Carp::CarpLevel = $Carp::CarpLevel + 1;
$self->{Carp} = Carp::longmess($msg);
$Carp::Internal{ __PACKAGE__ . "" }--;
}
sub getMessage {
$_[0]->{Message};
}
sub setMessage {
$_[0]->{Message} = $_[1];
}
sub fillTest {
my $self = shift;
my $builder = shift;
my $prev_test = $builder->current_test;
$self->{Test} = $prev_test;
my @tests = $builder->details;
my $prev_test_name = $prev_test ? $tests[$prev_test - 1]->{name} : "";
$self->{TestName} = $prev_test_name;
}
sub getTest {
$_[0]->{Test};
}
sub getTestName {
$_[0]->{TestName};
}
sub toString {
my $self = shift;
return <<EOM;
Previous test $self->{Test} '$self->{TestName}'
$self->{Carp}
EOM
}
1;
|