Branch Coverage

File:blib/lib/App/Test/Generator.pm
Coverage:78.2%

line%coveragebranch
161750TFif scalar @_ == 0
162350TFref $_[0] ne 'HASH' ? :
1629100TFif (ref $_[0] eq 'HASH' or defined $_[2]) { }
1641100TFif ($params->{'schema_file'}) { }
100TFelsif ($params->{'input_file'}) { }
50TFelsif ($params->{'schema'}) { }
1650100TFif (defined $schema_file)
1657100TFif (defined $schema_file) { }
1670100TFif exists $schema->{'cases'}
167150TFif exists $schema->{'edge_cases'}
1672100TFif exists $schema->{'type_edge_cases'}
1674100TFif exists $schema->{'module'} and length $schema->{'module'}
1675100TFif exists $schema->{'function'}
1676100TFif (exists $schema->{'new'})
1677100TFdefined $schema->{'new'} ? :
1679100TFif exists $schema->{'yaml_cases'}
1680100TFif exists $schema->{'seed'}
1681100TFif exists $schema->{'iterations'}
1683100TFif exists $schema->{'edge_case_array'}
1686100TFif exists $schema->{'config'}
1691100TFif (not $module) { }
100TFelsif ($module eq $MODULE_BUILTIN) { }
1692100TFif ($schema_file)
1697100TFif (_is_perl_builtin($module))
170550TFif ($module and length $module and $module ne "builtin")
1712100TFif defined $module and length $module
172150TFif defined $seed and $seed eq ""
1725100TFif (defined $yaml_cases)
1726100TFunless -f $yaml_cases
172950TFif ($yaml_data and ref $yaml_data eq "HASH")
1735100TFunless ($outputs and ref $outputs eq "ARRAY")
174850TFif (exists $cases{$k} and ref $cases{$k} eq "ARRAY" and ref $yaml_corpus_data{$k} eq "ARRAY")
1753100TFif (my $hints = delete $schema->{'_yamltest_hints'})
175450TFif (my $boundaries = $hints->{'boundary_values'})
175750TFif (my $invalid = $hints->{'invalid'})
1763100TFif ($schema->{'type'} and $schema->{'type'} =~ /^(integer|number|float)$/u)
176550TFunless defined $_
1766100TFif &Scalar::Util::looks_like_number($_)
177450TFif (exists $schema->{'relationships'} and ref $schema->{'relationships'} eq "ARRAY")
17890TFif ($type eq 'mutually_exclusive') { }
0TFelsif ($type eq 'required_group') { }
0TFelsif ($type eq 'conditional_requirement') { }
0TFelsif ($type eq 'dependency') { }
0TFelsif ($type eq 'value_constraint') { }
0TFelsif ($type eq 'value_conditional') { }
1836100TF&Scalar::Util::looks_like_number($_) ? :
50TFdefined $_ ? :
184250TFunless defined $a
184350TFunless defined $b
1848100TFif $na and $nb
1849100TFif $na
1850100TFif $nb
1859100TFif (scalar @edge_case_array)
1868100TFif (ref $config{$key} eq "HASH")
1871100TFif (not defined $config{$key} && $config{$key}) { }
1882100TFif (scalar keys %input == 1 and exists $input{'type'} and not ref $input{'type'}) { }
189150TFif (defined(my $re = $output{'matches'}))
18920TFif (ref $re ne "Regexp")
18960TFif ($@) { }
190850TFif (defined(my $re = $output{'nomatch'}))
19090TFif (ref $re ne "Regexp")
19130TFif ($@) { }
1922100TF$new && ref $new eq 'HASH' ? :
1925100TFif (keys %transforms)
1929100TFif ($transforms_code)
1946100TFif (keys %transforms and $config{'properties'}{'enable'} // 0)
1963100TFif (keys %accessor)
196850TFunless (defined $new)
1973100TFif ($type eq "getset")
1974100TFif (scalar keys %input != 1)
1977100TFif (scalar keys %output == 0)
1984100TF$module ? :
1988100TFif (defined $new and defined $module) { }
100TFelsif (defined $module and length $module) { }
1990100TFif ($new_code eq '') { }
1996100TFif ($has_positions) { }
199850TFif (defined $accessor{'type'})
19990TFif ($accessor{'type'} eq 'getter') { }
0TFelsif ($accessor{'type'} eq 'getset') { }
20060TFif ($accessor{'type'} eq "getset" or $accessor{'type'} eq "getter")
20100TFif ($accessor{'type'} eq "getter")
20150TFif ($output{'_returns_self'})
202150TFif ($output{'_returns_self'}) { }
100TFelsif (defined $accessor{'type'} and $accessor{'type'} eq 'getset') { }
2026100TFif (scalar keys %input == 0)
2027100TFif (defined $accessor{'type'} and $accessor{'type'} eq "getter")
2033100TFif ($function eq 'new') { }
203450TFif ($has_positions) { }
2040100TFif ($has_positions) { }
2047100TFif ($has_positions) { }
2056100TFif (($output{'type'} // "") eq "array")
205750TFif (defined $call_code)
206050TFif (defined $position_code)
2067100TFif (%all_cases)
207350TFunless $inputs
207750TFif ($expected_str eq q['_STATUS:DIES']) { }
50TFelsif ($expected_str eq q['_STATUS:WARNS']) { }
208350TFif (ref $inputs eq "HASH")
208750TFif (ref $inputs eq 'ARRAY') { }
0TFelsif (ref $inputs eq 'HASH') { }
210050TFif ($input_str eq "undef" and not $config{'test_undef'})
210350TFif ($new) { }
21040TFif ($status eq 'DIES') { }
0TFelsif ($status eq 'WARNS') { }
21150TFif (($output{'type'} // '') eq 'boolean') { }
21160TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
212850TFif ($status eq 'DIES') { }
50TFelsif ($status eq 'WARNS') { }
21290TFif ($module) { }
21370TFif ($module) { }
214650TFref $inputs eq 'ARRAY' ? :
214950TFif (($output{'type'} // '') eq 'boolean') { }
21500TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
2167100TFif (defined $seed)
2173100TFdefined $position_code ? :
220950TFunless $tt->process($template, $vars, \$test)
2211100TFif ($test_file) { }
221650TFunless open my $fh, ">:encoding(UTF-8)", $test_file
2219100TFif ($module) { }
2244100TFunless defined $name
2313100TFunless defined $schema_file
2315100TFunless length $schema_file
2319100TFunless -r $schema_file
232450TFif (my $schema = "Config::Abstraction"->new("config_dirs", [".", ""], "config_file", $schema_file, "no_fixate", 1))
232950TFif ($schema = $schema->all)
2332100TFif (exists $schema->{$LEGACY_PERL_KEY_1} or exists $schema->{$LEGACY_PERL_KEY_2})
2373100TFunless exists $schema->{$section}
2377100TFif ref $schema->{$section} eq "HASH"
2382100TFif defined $schema->{$section} and $schema->{$section} eq "undef"
2424100TFunless (defined $schema->{'module'} or defined $schema->{'function'})
2430100TFunless (defined $schema->{'input'} or defined $schema->{'output'})
2435100TFif ($schema->{'input'} and ref $schema->{'input'} ne "HASH")
2436100TFif ($schema->{'input'} eq 'undef') { }
2444100TFif ($schema->{'input'})
2451100TFif (exists $schema->{'transforms'} and ref $schema->{'transforms'} eq "HASH")
2456100TFif (ref $schema->{'config'} eq "HASH")
2460100TFunless $VALID_CONFIG_KEYS{$k}
2482100TFunless length $param
2488100TFif (ref $spec) { }
2490100TFunless defined $spec->{'type'}
249250TFif $spec->{'type'} eq "coderef"
2494100TFunless _valid_type($spec->{'type'})
249650TFunless _valid_type($spec)
2527100TFunless ref $spec eq "HASH" and defined $spec->{'position'}
2533100TFunless $pos =~ /^\d+$/u
2538100TFif exists $positions{$pos}
2544100TFif ($has_positions)
2547100TFunless (ref $spec eq "HASH" and defined $spec->{'position'})
2557100TFif ($sorted[$i] != $i)
2585100TFunless ref $spec eq "HASH"
2589100TFif (defined $spec->{'semantic'})
2591100TFunless (exists $semantic_generators->{$semantic})
2600100TFif ($spec->{'enum'} and $spec->{'memberof'})
2606100TFif (exists $spec->{$type})
2608100TFunless ref $spec->{$type} eq "ARRAY"
2637100TFunless exists $transform->{'properties'}
2640100TFunless ref $transform->{'properties'} eq "ARRAY"
2643100TFif (not ref $prop) { }
100TFelsif (ref $prop eq 'HASH') { }
2645100TFunless (exists $builtin_props->{$prop})
2652100TFunless ($prop->{'name'} and $prop->{'code'})
2695100TFif $field eq $CONFIG_PROPERTIES_KEY
2696100TFif $field eq "timeout"
2698100TFif (exists $config->{$field} and defined $config->{$field}) { }
270150TFif (defined(my $b = $Readonly::Values::Boolean::booleans{$config->{$field}}))
2714100TFunless ref $config->{$CONFIG_PROPERTIES_KEY} eq "HASH"
2746100TFunless defined $type
2787100TFunless defined $name and length $name
2791100TF$opts{'package'} ? :
2794100TFunless $name =~ /$re/u
2851100TFunless $module
2856100TFif ($schema_file and not $mod_info)
287150TFif ($verbose)
2880100TFif ($ENV{$ENV_VALIDATE_LOAD})
288350TFunless ($loaded)
289250TFif ($verbose)
2953100TFunless defined $v
3024100TFunless $href and ref $href eq "HASH"
3034100TFunless (defined $def and ref $def eq "HASH")
3035100TFif (defined $def and not ref $def and _valid_type($def)) { }
3048100TFunless defined $def->{$subk}
305250TFif (ref $def->{$subk})
30530TFunless (ref $def->{$subk} eq "ARRAY" or ref $def->{$subk} eq "Regexp")
3066100TFif ($subk eq $KEY_MATCHES or $subk eq $KEY_NOMATCH) { }
306950TFref $def->{$subk} eq 'Regexp' ? :
307050TFif ($@ or not defined $re)
3137100TFunless $href and ref $href eq "HASH"
3197100TFunless $href and ref $href eq "HASH"
3205100TFunless ref $aref eq "ARRAY"
3242100TFunless defined $input_spec and ref $input_spec eq "HASH"
3247100TFunless ref $input_spec->{$field} eq "HASH"
3250100TFif defined $input_spec->{$field}{'position'}
328250TFif ref $s
3291100TFunless defined $s
3299100TFunless $s =~ /\Q$l\E|\Q$r\E/u
3307100TFif index($s, $d) == $INDEX_NOT_FOUND
334250TFif ref $s
3346100TFunless defined $s
3410100TFif $depth > 100
3413100TFunless defined $v
3417100TFif $v eq "true"
3418100TFif $v eq "false"
3420100TFif (ref $v)
3422100TFif (ref $v eq "ARRAY")
3428100TFif (ref $v eq "Regexp")
3433100TFif $mods
3444100TF&looks_like_number($v) ? :
3515100TFif (not defined $input_spec or not ref $input_spec and $input_spec eq "undef")
3524100TFunless ref $input_spec eq "HASH"
354050TFif (exists $transform->{'properties'} and ref $transform->{'properties'} eq "ARRAY")
355750TFunless @all_props
356950TFunless ref $spec eq "HASH"
357850TFif (defined $gen and length $gen)
3593100TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
360850TFif (_has_positions($input_spec)) { }
4073100TFunless defined $spec and ref $spec eq "HASH"
4083100TFif ($type eq "string" and defined $spec->{'semantic'})
408750TFif (exists $generators->{$semantic_type}) { }
4107100TFif ($type eq "integer")
4111100TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
100TFelsif (not defined $max) { }
4130100TFif ($type eq "number" or $type eq "float")
4134100TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
100TFelsif (not defined $max) { }
4140100TFif ($max == $ZERO_BOUNDARY) { }
100TFelsif ($max > $ZERO_BOUNDARY) { }
4153100TFif ($min == $ZERO_BOUNDARY) { }
100TFelsif ($min > $ZERO_BOUNDARY) { }
4167100TFif ($range <= $ZERO_BOUNDARY)
4180100TFif ($type eq "string")
4186100TFif (defined $spec->{'matches'})
4196100TFref $pattern eq 'Regexp' ? :
419750TFif ($@ or not defined $compiled)
4204100TFif (defined $spec->{'max'}) { }
100TFelsif (defined $spec->{'min'}) { }
4219100TFif ($type eq "boolean")
4226100TFif ($type eq "arrayref")
4237100TFif ($type eq "hashref")
4369100TFunless defined $spec and ref $spec eq "HASH"
4373100TFif defined $spec->{'type'}
4378100TFunless ref $spec->{$field} eq "HASH"
4380100TFif defined $spec->{$field}{'type'}
4422100TFunless defined $properties and ref $properties eq "ARRAY"
4423100TFunless @{$properties;}
4435100TFif ($prop->{'should_die'}) { }
4497100TFunless defined $input_spec
4498100TFif not ref $input_spec and $input_spec eq "undef"
4507100TFif (_is_numeric_transform($input_spec, $output_spec))
4508100TFif (defined $output_spec->{'min'})
4516100TFif (defined $output_spec->{'max'})
4526100TFif ($transform_name =~ /$TRANSFORM_POSITIVE_PATTERN/iu)
4537100TFif (defined $output_spec->{'value'})
454250TFref $expected ? :
4553100TFif (_is_string_transform($input_spec, $output_spec))
4554100TFif (defined $output_spec->{'min'})
456150TFif (defined $output_spec->{'max'})
456850TFif (defined $output_spec->{'matches'})
45750TFref $pattern eq 'Regexp' ? :
45760TFif ($@ or not defined $compiled) { }
4592100TFif (_same_type($input_spec, $output_spec))
4597100TFif ($type eq "number" or $type eq "integer" or $type eq "float")
4611100TFunless (($output_spec->{'type'} // "") eq "undef")
4677100TFif (not ref $prop_def) { }
100TFelsif (ref $prop_def eq 'HASH') { }
4681100TFunless (exists $builtin_properties->{$prop_name})
469150TFif (_has_positions($input_spec)) { }
470250TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
4726100TFunless ($prop_code)
473350TFunless ($prop_code =~ /\$/u or $prop_code =~ /\w+/u)