| 1 | package Test::Mojo::Role::Debug; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use Mojo::Base -base; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Mojo::File qw/path/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use Mojo::Util qw/encode/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Role::Tiny; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Carp qw/croak/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Test::More (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | our $VERSION = '1.005003'; # VERSION | |||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 11 | ▶ | sub d { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
d: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 11 | my ( $self, $selector, $dump_file ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 14 | 11 | ▶ | return $self->success ? $self : $self->da( $selector, $dump_file ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 8 | ▶ | sub da { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
da: called CC=10 SCAR=23.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 8 | my ( $self, $selector, $dump_file ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 8 | ▶ | my $markup = length($selector//'') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$selector // ""
MC/DC100%1/1
$selector // ""
$selector
Truth table100%2/2
A
A= $selector
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | ? $self->tx->res->dom->at($selector) | ||||||||||||||||||||||||||||||||||||||||||
| 21 | : $self->tx->res->dom; | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 8 | ▶ | unless ( defined $markup and length $markup ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $markup and length $markup
MC/DC50%1/2
defined $markup and length $markup
defined $markup
length $markup
Truth table66%2/3
A and B
A= defined $markupB= length $markup
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 4 | Test::More::diag "\nDEBUG DUMPER: the selector ($selector) you provided " | |||||||||||||||||||||||||||||||||||||||||
| 25 | . "did not match any elements\n\n"; | ||||||||||||||||||||||||||||||||||||||||||
| 26 | 4 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 4 | ▶ | if ($markup =~ /<!-- Request ID: \S+ -->/ | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$markup =~ /<!-- Request ID: \S+ -->/u and $markup->at("div#mojobar div#mojobar-links") and my $mojo_error = $markup->at("div#wrapperlicious pre#error")
$markup =~ /<!-- Request ID: \S+ -->/u and $markup->at("div#mojobar div#mojobar-links")
MC/DC0%0/3
$markup =~ /<!-- Request ID: \S+ -->/u and $markup->at("div#mojobar div#mojobar-links") and my $mojo_error = $markup->at("div#wrapperlicious pre#error")
$markup =~ /<!-- Request ID: \S+ -->/u
$markup->at("div#mojobar div#mojobar-links")
my $mojo_error = $markup->at("div#wrapperlicious pre#error")
Truth table25%1/4
A and B and C
A= $markup =~ /<!-- Request ID: \S+ -->/uB= $markup->at("div#mojobar div#mojobar-links")C= my $mojo_error = $markup->at("div#wrapperlicious pre#error")
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | and $markup->at('div#mojobar div#mojobar-links') | ||||||||||||||||||||||||||||||||||||||||||
| 31 | and (my $mojo_error = $markup->at('div#wrapperlicious pre#error')) | ||||||||||||||||||||||||||||||||||||||||||
| 32 | ) { | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | $markup = $mojo_error->all_text; | |||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | 4 | ▶ | if (length($dump_file//'')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$dump_file // ""
MC/DC100%1/1
$dump_file // ""
$dump_file
Truth table100%2/2
A
A= $dump_file
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | 2 | Test::More::diag "\nDEBUG DUMPER: dumping data to $dump_file\n\n"; | |||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | path($dump_file)->spurt(encode 'utf-8', $markup); | |||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||
| 40 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 41 | 2 | Test::More::diag "\nDEBUG DUMPER:\n$markup\n\n"; | |||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | 4 | $self; | |||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 2 | q| | |||||||||||||||||||||||||||||||||||||||||
| 48 | The optimist says: "The glass is half full" | ||||||||||||||||||||||||||||||||||||||||||
| 49 | The pessimist says: "The glass is half empty" | ||||||||||||||||||||||||||||||||||||||||||
| 50 | The programmer says: "The glass is twice as large necessary" | ||||||||||||||||||||||||||||||||||||||||||
| 51 | |; | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | __END__ | ||||||||||||||||||||||||||||||||||||||||||