« lib/VSGDR/UnitTest/TestSet/Representation/NET/VB.pm
↑ Summary
lib/VSGDR/UnitTest/TestSet/Representation/NET2.pm »
| 1 | package VSGDR::UnitTest::TestSet::Test; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use 5.010; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | #our \$VERSION = '1.01'; | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 1 | ▶ | use Data::Dumper ; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 1 | ▶ | use Carp ; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 1 | ▶ | use vars qw($AUTOLOAD); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 1 | my %ok_field; | |||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | # Authorize four attribute fields | ||||||||||||||||||||
| 19 | { | ||||||||||||||||||||
| 20 | #for my $attr ( qw(nameSpace className testName testDataName ) ) { $ok_field{$attr}++; } | ||||||||||||||||||||
| 21 | #for my $attr ( qw(testName testActionDataName postTestAction testAction preTestAction) ) { $ok_field{$attr}++; } | ||||||||||||||||||||
| 22 | 1 | for my $attr ( qw(testName testActionDataName ) ) { $ok_field{$attr}++; } | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | sub new { | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 0 | ▶ | local $_ = undef ; | ||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | #warn Dumper @_; | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | my $invocant = shift ; | |||||||||||||||||||
| 31 | 0 | ▶ | my $class = ref($invocant) || $invocant ; | ||||||||||||||||||
|
Condition0%0/3
ref $invocant || $invocant
MC/DC0%0/2
ref $invocant || $invocant
ref $invocant
$invocant
Truth table0%0/3
A || B
A= ref $invocantB= $invocant
| |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | my @elems = @_ ; | |||||||||||||||||||
| 34 | 0 | my $self = bless {}, $class ; | |||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 0 | $self->_init(@elems) ; | |||||||||||||||||||
| 37 | 0 | return $self ; | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | sub _init { | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 0 | ▶ | local $_ = undef ; | ||||||||||||||||||
|
Subroutine
_init: not called CC=5 SCAR=34.0
| |||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | #warn Dumper @_; | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 0 | my $self = shift ; | |||||||||||||||||||
| 48 | 0 | ▶ | my $class = ref($self) || $self ; | ||||||||||||||||||
|
Condition0%0/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table0%0/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||
| 49 | 0 | ▶ | my $ref = shift or croak "no arg"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | #print Dumper $ref ; | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | 0 | for my $attr ( qw(TESTNAME TESTACTIONDATANAME PRETESTACTION TESTACTION POSTTESTACTION ) ) { $self->{OK_PARAMS}{$attr}++; } | |||||||||||||||||||
| 54 | 0 | my @validargs = grep { $$ref{$_} } keys %{$self->{OK_PARAMS}} ; | |||||||||||||||||||
| 55 | #warn Dumper @validargs ; | ||||||||||||||||||||
| 56 | 0 | ▶ | croak "bad args" | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 57 | if scalar(@validargs) != 5 ; | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 0 | my ${TestName} = $$ref{TESTNAME}; | |||||||||||||||||||
| 61 | 0 | my ${TestActionDataName} = $$ref{TESTACTIONDATANAME}; | |||||||||||||||||||
| 62 | 0 | my ${PreTestAction} = $$ref{PRETESTACTION}; | |||||||||||||||||||
| 63 | 0 | my ${TestAction} = $$ref{TESTACTION}; | |||||||||||||||||||
| 64 | 0 | my ${PostTestAction} = $$ref{POSTTESTACTION}; | |||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 0 | $self->testName(${TestName}) ; | |||||||||||||||||||
| 67 | 0 | $self->testActionDataName(${TestActionDataName}) ; | |||||||||||||||||||
| 68 | 0 | $self->preTestAction(${PreTestAction}) ; | |||||||||||||||||||
| 69 | 0 | $self->testAction(${TestAction}) ; | |||||||||||||||||||
| 70 | 0 | $self->postTestAction(${PostTestAction}) ; | |||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 0 | $self->{TESTCONDITIONS} = [] ; | |||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | 0 | $self->{PRETEST_TESTCONDITIONS} = [] ; | |||||||||||||||||||
| 75 | 0 | $self->{TEST_TESTCONDITIONS} = [] ; | |||||||||||||||||||
| 76 | 0 | $self->{POSTTEST_TESTCONDITIONS} = [] ; | |||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | #multiple tests | ||||||||||||||||||||
| 79 | #each with multiple actions | ||||||||||||||||||||
| 80 | #each with multiple conditions | ||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | # $self->testName(${TestName}) ; | ||||||||||||||||||||
| 83 | # $self->testDataName(${TestDataName}) ; | ||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | 0 | return ; | |||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | } | ||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | #-- TODO ---> | ||||||||||||||||||||
| 90 | sub actions { | ||||||||||||||||||||
| 91 | 0 | ▶ | my $self = shift or croak 'no self'; | ||||||||||||||||||
|
Subroutine
actions: not called CC=5 SCAR=34.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||
| 92 | 0 | my %actions ; | |||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 0 | ▶ | if ( $self->preTestAction() !~ m/^(?:null|nothing)$/ix ) { $actions{$self->testName()."_".$self->preTestAction()} = 1; } | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 95 | 0 | ▶ | if ( $self->testAction() !~ m/^(?:null|nothing)$/ix ) { $actions{$self->testName()."_".$self->testAction()} = 1; } | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 96 | 0 | ▶ | if ( $self->postTestAction() !~ m/^(?:null|nothing)$/ix ) { $actions{$self->testName()."_".$self->postTestAction()} = 1; } | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | 0 | return \%actions ; | |||||||||||||||||||
| 99 | } | ||||||||||||||||||||
| 100 | |||||||||||||||||||||
| 101 | #sub hasAction { | ||||||||||||||||||||
| 102 | # my $self = shift or croak 'no self'; | ||||||||||||||||||||
| 103 | # my $action = shift ; | ||||||||||||||||||||
| 104 | # croak 'No action requested' if not defined $action; | ||||||||||||||||||||
| 105 | # return exists($self->{ACTIONS}{$action}) ; | ||||||||||||||||||||
| 106 | #} | ||||||||||||||||||||
| 107 | |||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | |||||||||||||||||||||
| 110 | sub preTestActionLiteral { | ||||||||||||||||||||
| 111 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
preTestActionLiteral: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 112 | 0 | return "PretestAction"; | |||||||||||||||||||
| 113 | } | ||||||||||||||||||||
| 114 | sub testActionLiteral { | ||||||||||||||||||||
| 115 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
testActionLiteral: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 116 | 0 | return "TestAction"; | |||||||||||||||||||
| 117 | } | ||||||||||||||||||||
| 118 | sub postTestActionLiteral { | ||||||||||||||||||||
| 119 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
postTestActionLiteral: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 120 | 0 | return "PosttestAction"; | |||||||||||||||||||
| 121 | } | ||||||||||||||||||||
| 122 | |||||||||||||||||||||
| 123 | sub preTestActionLiteralName { | ||||||||||||||||||||
| 124 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
preTestActionLiteralName: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 125 | 0 | return $self->testName . '_' . $self->preTestActionLiteral() ; | |||||||||||||||||||
| 126 | } | ||||||||||||||||||||
| 127 | sub testActionLiteralName { | ||||||||||||||||||||
| 128 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
testActionLiteralName: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 129 | 0 | return $self->testName . '_' . $self->testActionLiteral() ; | |||||||||||||||||||
| 130 | } | ||||||||||||||||||||
| 131 | sub postTestActionLiteralName { | ||||||||||||||||||||
| 132 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
postTestActionLiteralName: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 133 | 0 | return $self->testName . '_' . $self->postTestActionLiteral() ; | |||||||||||||||||||
| 134 | } | ||||||||||||||||||||
| 135 | |||||||||||||||||||||
| 136 | sub commentifyTestName { | ||||||||||||||||||||
| 137 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
commentifyTestName: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 138 | 0 | ▶ | my $commentChars = shift or croak 'No Chars' ; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 139 | 0 | return <<"EOF"; | |||||||||||||||||||
| 140 | ${commentChars} | ||||||||||||||||||||
| 141 | 0 | ${commentChars}@{[$self->testName()]} | |||||||||||||||||||
| 142 | ${commentChars} | ||||||||||||||||||||
| 143 | EOF | ||||||||||||||||||||
| 144 | } | ||||||||||||||||||||
| 145 | |||||||||||||||||||||
| 146 | |||||||||||||||||||||
| 147 | sub commentifyPreTestAction { | ||||||||||||||||||||
| 148 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
commentifyPreTestAction: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 149 | 0 | ▶ | my $commentChars = shift or croak 'No Chars' ; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 150 | 0 | return <<"EOF"; | |||||||||||||||||||
| 151 | ${commentChars} | ||||||||||||||||||||
| 152 | 0 | ${commentChars}@{[$self->preTestAction()]} | |||||||||||||||||||
| 153 | ${commentChars} | ||||||||||||||||||||
| 154 | EOF | ||||||||||||||||||||
| 155 | } | ||||||||||||||||||||
| 156 | |||||||||||||||||||||
| 157 | sub commentifyTestAction { | ||||||||||||||||||||
| 158 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
commentifyTestAction: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 159 | 0 | ▶ | my $commentChars = shift or croak 'No Chars' ; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 160 | 0 | return <<"EOF"; | |||||||||||||||||||
| 161 | ${commentChars} | ||||||||||||||||||||
| 162 | 0 | ${commentChars}@{[$self->testAction()]} | |||||||||||||||||||
| 163 | ${commentChars} | ||||||||||||||||||||
| 164 | EOF | ||||||||||||||||||||
| 165 | } | ||||||||||||||||||||
| 166 | |||||||||||||||||||||
| 167 | sub commentifyPostTestAction { | ||||||||||||||||||||
| 168 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
commentifyPostTestAction: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 169 | 0 | ▶ | my $commentChars = shift or croak 'No Chars' ; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 170 | 0 | return <<"EOF"; | |||||||||||||||||||
| 171 | ${commentChars} | ||||||||||||||||||||
| 172 | 0 | ${commentChars}@{[$self->postTestAction()]} | |||||||||||||||||||
| 173 | ${commentChars} | ||||||||||||||||||||
| 174 | EOF | ||||||||||||||||||||
| 175 | } | ||||||||||||||||||||
| 176 | |||||||||||||||||||||
| 177 | sub commentifyActionDataName { | ||||||||||||||||||||
| 178 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
commentifyActionDataName: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 179 | 0 | ▶ | my $commentChars = shift or croak 'No Chars' ; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 180 | 0 | return <<"EOF"; | |||||||||||||||||||
| 181 | ${commentChars} | ||||||||||||||||||||
| 182 | 0 | ${commentChars}@{[$self->testActionDataName()]} | |||||||||||||||||||
| 183 | ${commentChars} | ||||||||||||||||||||
| 184 | EOF | ||||||||||||||||||||
| 185 | } | ||||||||||||||||||||
| 186 | |||||||||||||||||||||
| 187 | sub preTest_conditions { | ||||||||||||||||||||
| 188 | 0 | ▶ | my $self = shift or croak 'no self'; | ||||||||||||||||||
|
Subroutine
preTest_conditions: not called CC=4 SCAR=30.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||
| 189 | 0 | my $conditions ; | |||||||||||||||||||
| 190 | 0 | ▶ | $conditions = shift if @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 191 | 0 | ▶ | if ( defined $conditions ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 192 | 0 | my @conditions = @$conditions ; | |||||||||||||||||||
| 193 | 0 | $self->{PRETEST_TESTCONDITIONS} = \@conditions ; | |||||||||||||||||||
| 194 | } | ||||||||||||||||||||
| 195 | 0 | return $self->{PRETEST_TESTCONDITIONS} ; | |||||||||||||||||||
| 196 | } | ||||||||||||||||||||
| 197 | |||||||||||||||||||||
| 198 | sub test_conditions { | ||||||||||||||||||||
| 199 | 0 | ▶ | my $self = shift or croak 'no self'; | ||||||||||||||||||
|
Subroutine
test_conditions: not called CC=4 SCAR=30.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||
| 200 | 0 | my $conditions ; | |||||||||||||||||||
| 201 | 0 | ▶ | $conditions = shift if @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 202 | 0 | ▶ | if ( defined $conditions ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 203 | 0 | my @conditions = @$conditions ; | |||||||||||||||||||
| 204 | 0 | $self->{TEST_TESTCONDITIONS} = \@conditions ; | |||||||||||||||||||
| 205 | } | ||||||||||||||||||||
| 206 | 0 | return $self->{TEST_TESTCONDITIONS} ; | |||||||||||||||||||
| 207 | } | ||||||||||||||||||||
| 208 | |||||||||||||||||||||
| 209 | sub postTest_conditions { | ||||||||||||||||||||
| 210 | 0 | ▶ | my $self = shift or croak 'no self'; | ||||||||||||||||||
|
Subroutine
postTest_conditions: not called CC=4 SCAR=30.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||
| 211 | 0 | my $conditions ; | |||||||||||||||||||
| 212 | 0 | ▶ | $conditions = shift if @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 213 | 0 | ▶ | if ( defined $conditions ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 214 | 0 | my @conditions = @$conditions ; | |||||||||||||||||||
| 215 | 0 | $self->{POSTTEST_TESTCONDITIONS} = \@conditions ; | |||||||||||||||||||
| 216 | } | ||||||||||||||||||||
| 217 | 0 | return $self->{POSTTEST_TESTCONDITIONS} ; | |||||||||||||||||||
| 218 | } | ||||||||||||||||||||
| 219 | |||||||||||||||||||||
| 220 | sub conditions { | ||||||||||||||||||||
| 221 | 0 | ▶ | my $self = shift or croak 'no self'; | ||||||||||||||||||
|
Subroutine
conditions: not called CC=4 SCAR=30.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||
| 222 | 0 | my $conditions ; | |||||||||||||||||||
| 223 | 0 | ▶ | $conditions = shift if @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 224 | 0 | ▶ | if ( defined $conditions ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 225 | 0 | croak 'obsoleted method' ; | |||||||||||||||||||
| 226 | } | ||||||||||||||||||||
| 227 | 0 | my $preTestConditions = $self->preTest_conditions() ; | |||||||||||||||||||
| 228 | 0 | my $testConditions = $self->test_conditions() ; | |||||||||||||||||||
| 229 | 0 | my $postTestConditions = $self->postTest_conditions() ; | |||||||||||||||||||
| 230 | 0 | my @Conditions = flatten ([@$preTestConditions,@$testConditions,@$postTestConditions]); | |||||||||||||||||||
| 231 | |||||||||||||||||||||
| 232 | 0 | return \@Conditions ; | |||||||||||||||||||
| 233 | } | ||||||||||||||||||||
| 234 | |||||||||||||||||||||
| 235 | sub preTestAction { | ||||||||||||||||||||
| 236 | 0 | ▶ | my $self = shift or croak 'no self'; | ||||||||||||||||||
|
Subroutine
preTestAction: not called CC=5 SCAR=34.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||
| 237 | 0 | my $action ; | |||||||||||||||||||
| 238 | 0 | ▶ | $action = shift if @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 239 | # normalise | ||||||||||||||||||||
| 240 | 0 | ▶ | if ( defined $action ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 241 | 0 | ▶ | $action = 'null' if $action =~ m{^null|nothing$}ix ; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 242 | 0 | $self->{PRETESTACTION} = $action ; | |||||||||||||||||||
| 243 | } | ||||||||||||||||||||
| 244 | 0 | return $self->{PRETESTACTION} ; | |||||||||||||||||||
| 245 | |||||||||||||||||||||
| 246 | } | ||||||||||||||||||||
| 247 | sub testAction { | ||||||||||||||||||||
| 248 | 0 | ▶ | my $self = shift or croak 'no self'; | ||||||||||||||||||
|
Subroutine
testAction: not called CC=5 SCAR=34.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||
| 249 | 0 | my $action ; | |||||||||||||||||||
| 250 | 0 | ▶ | $action = shift if @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 251 | # normalise | ||||||||||||||||||||
| 252 | 0 | ▶ | if ( defined $action ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 253 | 0 | ▶ | $action = 'null' if $action =~ m{^null|nothing$}ix ; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 254 | 0 | $self->{TESTACTION} = $action ; | |||||||||||||||||||
| 255 | } | ||||||||||||||||||||
| 256 | 0 | return $self->{TESTACTION} ; | |||||||||||||||||||
| 257 | |||||||||||||||||||||
| 258 | } | ||||||||||||||||||||
| 259 | sub postTestAction { | ||||||||||||||||||||
| 260 | 0 | ▶ | my $self = shift or croak 'no self'; | ||||||||||||||||||
|
Subroutine
postTestAction: not called CC=5 SCAR=34.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||
| 261 | 0 | my $action ; | |||||||||||||||||||
| 262 | 0 | ▶ | $action = shift if @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 263 | # normalise | ||||||||||||||||||||
| 264 | 0 | ▶ | if ( defined $action ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 265 | 0 | ▶ | $action = 'null' if $action =~ m{^null|nothing$}ix ; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 266 | 0 | $self->{POSTTESTACTION} = $action ; | |||||||||||||||||||
| 267 | } | ||||||||||||||||||||
| 268 | 0 | return $self->{POSTTESTACTION} ; | |||||||||||||||||||
| 269 | |||||||||||||||||||||
| 270 | } | ||||||||||||||||||||
| 271 | |||||||||||||||||||||
| 272 | |||||||||||||||||||||
| 273 | 0 | ▶ | sub flatten { return map { @$_} @_ } ; | ||||||||||||||||||
|
Subroutine
flatten: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 274 | |||||||||||||||||||||
| 275 | ▶ | sub DESTROY {} | |||||||||||||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 276 | |||||||||||||||||||||
| 277 | sub AUTOLOAD { | ||||||||||||||||||||
| 278 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
AUTOLOAD: not called CC=4 SCAR=30.0
| |||||||||||||||||||||
| 279 | 0 | my $attr = $AUTOLOAD; | |||||||||||||||||||
| 280 | 0 | $attr =~ s{.*::}{}x; | |||||||||||||||||||
| 281 | 0 | ▶ | return unless $attr =~ m{[^A-Z]}x; # skip DESTROY and all-cap methods | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 282 | 0 | ▶ | croak "invalid attribute method: ->$attr()" unless $ok_field{$attr}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 283 | 0 | ▶ | $self->{uc $attr} = shift if @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 284 | 0 | return $self->{uc $attr}; | |||||||||||||||||||
| 285 | } | ||||||||||||||||||||
| 286 | |||||||||||||||||||||
| 287 | 1 | 1 ; | |||||||||||||||||||
| 288 | |||||||||||||||||||||
| 289 | __DATA__ | ||||||||||||||||||||