Tester/Logger/HTTP.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 35 / 35 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Tester/Result/Upload.pm ↑ Summary Tester/Role/SentenceBroker.pm »
1 2 ▶use v5.14.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package JMAP::Tester::Logger::HTTP 0.113;
3  
4 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 my %counter;
11  
12 4 ▶sub _log_generic ($self, $tester, $type, $thing) {
Subroutine _log_generic: called CC=1 SCAR=0.0
13 4 my $i = $counter{$type}++;
14 4 my $ident = $tester->ident;
15 4 $self->write("=== BEGIN \U$type\E $$.$i ($ident) ===\n");
16 4 $self->write( $thing->as_string );
17 4 $self->write("=== END \U$type\E $$.$i ($ident) ===\n");
18 4 return;
19 }
20  
21 2 for my $which (qw(jmap misc upload download)) {
22 8 for my $what (qw(request response)) {
23 16 my $method = "log_${which}_${what}";
24 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
25 4 ▶ *$method = sub ($self, $tester, $arg) {
Subroutine __ANON__: called CC=1 SCAR=0.0
26 4 $self->_log_generic($tester, "$which $what", $arg->{"http_$what"});
27 }
28 16 }
29 }
30  
31 2 with 'JMAP::Tester::Logger';
32  
33 2 1;
34  
35 __END__
« Tester/Result/Upload.pm ↑ Summary Tester/Role/SentenceBroker.pm »