| 1 | 40 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 40 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | package Test::Deep::Stack 1.205; | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 40 | ▶ | use Carp qw( confess ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 40 | ▶ | use Scalar::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 40 | ▶ | use Test::Deep::MM qw( new init Stack Arrow ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | sub init | ||||||||||||||||||||||||||||
| 12 | 874 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 874 | my $self = shift; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 874 | $self->SUPER::init(@_); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 874 | ▶ | $self->setStack([]) unless $self->getStack; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | sub push | ||||||||||||||||||||||||||||
| 21 | 2206 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
push: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 22 | 2206 | my $self = shift; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 2206 | push(@{$self->getStack}, @_); | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | sub pop | ||||||||||||||||||||||||||||
| 28 | 1288 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
pop: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 29 | 1288 | my $self = shift; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 1288 | return pop @{$self->getStack}; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | sub render | ||||||||||||||||||||||||||||
| 35 | 119 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
render: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 36 | 119 | my $self = shift; | |||||||||||||||||||||||||||
| 37 | 119 | my $var = shift; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 119 | my $stack = $self->getStack; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 119 | $self->setArrow(0); | |||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 119 | foreach my $data (@$stack) | |||||||||||||||||||||||||||
| 44 | { | ||||||||||||||||||||||||||||
| 45 | 269 | my $exp = $data->{exp}; | |||||||||||||||||||||||||||
| 46 | 269 | ▶ | if (Scalar::Util::blessed($exp) and $exp->isa("Test::Deep::Cmp")) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($exp) and $exp->isa("Test::Deep::Cmp")
MC/DC0%0/2
builtin::blessed($exp) and $exp->isa("Test::Deep::Cmp")
builtin::blessed($exp)
$exp->isa("Test::Deep::Cmp")
Truth table33%1/3
A and B
A= builtin::blessed($exp)B= $exp->isa("Test::Deep::Cmp")
| |||||||||||||||||||||||||||||
| 47 | { | ||||||||||||||||||||||||||||
| 48 | 269 | $var = $exp->render_stack($var, $data); | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 269 | ▶ | $self->setArrow(0) if $exp->reset_arrow; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | else | ||||||||||||||||||||||||||||
| 53 | { | ||||||||||||||||||||||||||||
| 54 | 0 | confess "Don't know how to render '$exp'"; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 119 | return $var; | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | sub getLast | ||||||||||||||||||||||||||||
| 62 | 465 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
getLast: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 63 | 465 | my $self = shift; | |||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 465 | return $self->getStack->[-1]; | |||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | sub incArrow | ||||||||||||||||||||||||||||
| 69 | 35 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
incArrow: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 70 | 35 | my $self = shift; | |||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 35 | my $a = $self->getArrow; | |||||||||||||||||||||||||||
| 73 | 35 | $self->setArrow($a + 1); | |||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 35 | return $a; | |||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | sub length | ||||||||||||||||||||||||||||
| 79 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
length: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 80 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 0 | return @{$self->getStack} + 0; | |||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 40 | 1; | |||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | __END__ | ||||||||||||||||||||||||||||