Branch Coverage

blib/lib/Test/CGI/External.pm
Criterion Covered Total %
branch 122 268 45.5


line true false branch
30 29 97 if ($self->{'verbose'})
38 1 3 if ($self->{'verbose'})
40 1 0 if ($switch) { }
57 0 17 if ($^O eq 'MSWin32') { }
66 10 7 if (@command_line_options) { }
80 3 1 if ($switch and not $self->{'_use_io_uncompress_gunzip'})
82 0 3 if ($@)
84 0 0 if (not $self->{'no_warn'})
97 0 0 if ($switch)
99 0 0 if ($@)
100 0 0 unless ($self->{'no_warn'})
112 0 4 if ($@)
114 0 0 unless ($self->{'no_warn'} or $self->{'_warned_unicode_utf8'})
126 2 0 if ($mime_type) { }
152 0 0 unless defined $last_modified
162 0 0 if ($run_options{'expect_errors'})
163 0 0 unless ($self->{'no_warn'})
188 0 0 unless ($headers)
198 0 0 if ($last_modified) { }
216 18 0 if ($request_method) { }
217 0 18 if ($request_method and not $valid_request_method{$request_method})
218 0 0 unless ($self->{'no_warn'})
225 0 0 unless ($self->{'no_warn'})
276 20 29 if (not $self->{'set_env'}) { }
282 0 49 if ($ENV{$name})
283 0 0 unless ($self->{'no_warn'})
295 0 1 if ($@)
296 0 0 unless ($self->{'no_warn'} or $self->{'_warned_unicode_utf8'})
326 0 20 if (defined $query_string) { }
336 2 18 if ($options->{'no_check_request_method'}) { }
345 0 20 if ($content_type)
349 0 20 if ($options->{'HTTP_COOKIE'})
353 0 20 if ($remote_addr)
357 3 17 if (defined $options->{'input'})
359 1 2 if (utf8::is_utf8($self->{'input'}))
362 0 3 if ($self->{'bad_content_length'}) { }
373 6 14 if ($comp_test)
374 4 2 if ($verbose)
383 20 0 if ($self->{'command_line_options'})
392 0 20 if ($options->{'expect_failure'}) { }
399 0 20 if ($options->{'expect_errors'}) { }
400 0 0 if ($options->{'error_output'}) { }
408 0 20 if ($self->{'errors'}) { }
471 1 14 unless ($has_content_type)
479 0 14 unless ($lineok)
482 2 12 if ($self->{'mime_type'})
486 9 5 if ($expected_charset)
495 8 1 if ($has_charset)
506 4 16 if ($verbose)
516 0 29 if ($line =~ /^$/)
517 0 0 if ($line_number == 0) { }
527 1 28 if (not $line =~ /$line_re/) { }
538 4 16 if ($verbose)
563 0 20 unless ($output)
570 15 5 unless ($self->{'no_check_content'})
586 0 5 if ($self->{'_use_io_uncompress_gunzip'}) { }
592 0 0 unless ($status)
610 4 2 if ($verbose)
613 1 5 if (not $header =~ /Content-Encoding:.*\bgzip\b/i) { }
623 0 5 if ($@) { }
626 0 0 unless open my $temp, '>:bytes', $failedfile
628 0 0 unless close $temp
639 4 2 if ($verbose)
648 0 2 if ($verbose)
658 0 1 if ($method) { }
679 1 2 unless ($status =~ /^[0-9]{3}$/)
684 1 1 unless ($headers)
709 1 0 if ($headers->{'allow'})
718 0 2 if ($ok_method eq 'POST')
744 0 0 unless ($options)
749 0 0 if ($options->{'REQUEST_METHOD'} and $options->{'REQUEST_METHOD'} ne 'POST')
751 0 0 unless ($self->{'no_warn'})
756 0 0 unless ($options->{'CONTENT_TYPE'})
759 0 0 unless ($options->{'input'})
822 0 16 if (ref $options ne 'HASH')
828 0 16 unless ($self->{'cgi_executable'})
831 0 16 if (not $options) { }
833 0 0 unless ($self->{'no_warn'})
840 4 12 if ($self->{'verbose'})
843 0 16 if ($options->{'html'} and not $self->{'no_warn'}) { }
2 14 elsif ($options->{'json'} and not $self->{'no_warn'}) { }
0 28 elsif ($options->{'png'} and not $self->{'no_warn'}) { }
844 0 0 if ($self->{'mime_type'}) { }
845 0 0 if ($self->{'mime_type'} ne 'text/html')
855 2 0 if ($mime_type) { }
856 0 2 if ($mime_type ne 'text/plain' and $mime_type ne 'application/json')
866 0 0 if ($mime_type) { }
867 0 0 if ($mime_type ne 'image/png')
876 0 16 if ($options->{'png'}) { }
0 16 elsif ($options->{'html'}) { }
877 0 0 if ($options->{'html'} or $options->{'json'})
882 0 0 if ($options->{'json'})
895 16 0 if ($output)
897 6 10 if ($self->{'comp_test'})
901 11 5 if ($ecs)
902 10 1 if ($ecs =~ /utf\-?8/i) { }
903 4 6 if ($verbose)
909 0 1 if ($verbose)
915 0 1 if (not $@) { }
923 0 16 if ($self->{'cache_test'})
927 0 16 if ($options->{'html'})
930 2 14 if ($options->{'json'})
933 0 16 if ($options->{'png'})
942 3 17 if ($self->{'infile'})
943 0 3 unless unlink $self->{'infile'}
948 0 20 unless unlink $self->{'outfile'}
949 0 20 unless unlink $self->{'errfile'}
963 3 17 if (defined $self->{'input'}) { }
965 0 3 unless open my $in, '>:raw', $self->{'infile'}
967 0 3 unless close $in
977 0 20 unless close $out
980 0 20 unless close $err
985 20 0 if (-f $self->{'outfile'})
986 0 20 unless open my $out, '<', $self->{'outfile'}
990 0 20 unless close $out
993 20 0 if (-f $self->{'errfile'})
994 0 20 unless open my $err, '<', $self->{'errfile'}
998 0 20 unless close $err
1011 0 0 unless ($hvc)
1012 0 0 unless ($self->{'no_warn'})
1017 0 0 unless (-x $hvc)
1018 0 0 unless ($self->{'no_warn'})
1029 0 0 unless ($html_validator and -x $html_validator)
1035 0 0 unless open my $htmltovalidate, '>:encoding(utf8)', $html_temp_file
1037 0 0 unless close $htmltovalidate
1041 0 0 if (-s $html_validate)
1042 0 0 unless open my $in, '<', $html_validate
1046 0 0 unless close $in
1048 0 0 unless unlink $html_temp_file
1049 0 0 if (-f $html_validate)
1050 0 0 unless unlink $html_validate
1059 0 2 if ($@)
1063 1 1 if ($valid) { }
1075 0 0 if ($@)