Branch Coverage

blib/lib/Test/Perinci/Sub/Wrapper.pm
Criterion Covered Total %
branch 75 102 73.5


line true false branch
20 0 57 unless $test_args{'wrap_args'}
21 0 57 unless my $test_name = $test_args{'name'}
24 1 56 if $wrapper_type eq 'dynamic' and $test_args{'skip_dynamic'}
25 1 56 if $wrapper_type eq 'embed' and $test_args{'skip_embed'}
28 0 112 if ($test_args{'pretest'})
35 0 112 if exists $wrap_args->{'embed'}
36 56 56 if ($wrapper_type eq 'embed') { }
46 8 104 if ($test_args{'wrap_dies'}) { }
50 0 104 unless (&ok(!$wrap_eval_err, q[wrap doesn't die]))
56 26 78 if (defined $test_args{'wrap_status'})
59 0 26 unless &is($wrap_res->[0], $test_args{'wrap_status'}, "wrap status is $test_args{'wrap_status'}")
63 0 104 unless $wrap_res->[0] == 200
66 52 52 if ($wrapper_type eq 'embed') { }
94 2 1 $args_as eq 'array' ? :
1 3 $args_as eq 'hashref' ? :
48 4 $args_as eq 'hash' ? :
49 3 $src->{'postamble'} ? :
51 1 $sub_name =~ /\A\$/ ? :
2 1 $orig_args_as eq 'array' ? :
1 3 $orig_args_as eq 'hashref' ? :
48 4 $orig_args_as eq 'hash' ? :
49 3 $src->{'postamble'} ? :
98 0 52 unless (&ok(!$eval_err, 'embed code compiles ok'))
104 0 52 if $ENV{'LOG_PERINCI_WRAPPER_CODE'}
111 399 2139 if ($line =~ /(.*?)\s+#\s+(.*)/)
113 399 0 unless $before =~ /\S/
124 10 94 if ($call_argsr)
127 0 10 if ($test_args{'call_dies'}) { }
129 0 0 if ($test_args{'call_die_message'})
135 0 10 unless &ok(!$call_eval_err, q[call doesn't die])
139 10 0 if (defined $test_args{'call_status'})
140 0 10 unless &is(ref $call_res, 'ARRAY', 'call res is array')
143 0 10 unless &is($call_res->[0], $test_args{'call_status'}, "call status is $test_args{'call_status'}")
147 2 8 if (exists $test_args{'call_res'})
149 0 2 unless is_deeply($call_res, $test_args{'call_res'}, 'call res')
153 0 10 if (exists $test_args{'call_actual_res'})
155 0 0 unless is_deeply($call_res->[2], $test_args{'call_actual_res'}, 'call actual res')
159 2 8 if (exists $test_args{'call_actual_res_re'})
166 66 38 if ($test_args{'calls'})
174 2 168 if ($call->{'dies'}) { }
176 0 2 if ($call->{'die_message'})
182 0 168 unless &ok(!$eval_err, q[doesn't die])
186 154 14 if (defined $call->{'status'})
187 0 154 unless &is(ref $res, 'ARRAY', 'res is array')
190 0 154 unless &is($res->[0], $call->{'status'}, "status is $call->{'status'}")
194 16 152 if (exists $call->{'res'})
195 0 16 unless is_deeply($res, $call->{'res'}, 'res')
199 32 136 if (exists $call->{'actual_res'})
200 0 32 unless is_deeply($res->[2], $call->{'actual_res'}, 'actual res')
204 4 164 if (exists $call->{'actual_res_re'})
212 24 80 if ($test_args{'posttest'})