Branch Coverage

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

line%coveragebranch
187550TFif scalar @_ == 0
188150TFref $_[0] ne 'HASH' ? :
1888100TFif (ref $_[0] eq 'HASH' or defined $_[2]) { }
1902100TF$params->{'strict_documented'} ? :
1903100TFif ($params->{'schema_file'}) { }
100TFelsif ($params->{'input_file'}) { }
50TFelsif ($params->{'schema'}) { }
1912100TFif (defined $schema_file)
1915100TFif ($params->{'mutation_results'})
192150TFdefined $schema->{'module'} ? :
1929100TFif (defined $schema_file) { }
1942100TFif exists $schema->{'cases'}
194350TFif exists $schema->{'edge_cases'}
1944100TFif exists $schema->{'type_edge_cases'}
1946100TFif exists $schema->{'module'} and length $schema->{'module'}
1947100TFif exists $schema->{'function'}
1948100TFif (exists $schema->{'new'})
1949100TFdefined $schema->{'new'} ? :
195150TFif exists $schema->{'invocant'} and defined $schema->{'invocant'}
1952100TFif exists $schema->{'yaml_cases'}
1953100TFif exists $schema->{'seed'}
1954100TFif exists $schema->{'iterations'}
1956100TFif exists $schema->{'edge_case_array'}
1959100TFif exists $schema->{'config'}
1965100TFif (not $module) { }
100TFelsif ($module eq $MODULE_BUILTIN) { }
1966100TFif ($schema_file)
1971100TFif (_is_perl_builtin($module))
197950TFif ($module and length $module and $module ne "builtin")
1986100TFif defined $module and length $module
199550TFif defined $seed and $seed eq ""
1999100TFif (defined $yaml_cases)
2000100TFunless -f $yaml_cases
200350TFif ($yaml_data and ref $yaml_data eq "HASH")
2009100TFunless ($outputs and ref $outputs eq "ARRAY")
202250TFif (exists $cases{$k} and ref $cases{$k} eq "ARRAY" and ref $yaml_corpus_data{$k} eq "ARRAY")
2027100TFif (my $hints = delete $schema->{'_yamltest_hints'})
202850TFif (my $boundaries = $hints->{'boundary_values'})
203150TFif (my $invalid = $hints->{'invalid'})
2037100TFif ($schema->{'type'} and $schema->{'type'} =~ /^(integer|number|float)$/u)
203950TFunless defined $_
2040100TFif &Scalar::Util::looks_like_number($_)
204850TFif (exists $schema->{'relationships'} and ref $schema->{'relationships'} eq "ARRAY")
20630TFif ($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') { }
2110100TF&Scalar::Util::looks_like_number($_) ? :
50TFdefined $_ ? :
211650TFunless defined $a
211750TFunless defined $b
2122100TFif $na and $nb
2123100TFif $na
2124100TFif $nb
2133100TFif (scalar @edge_case_array)
2142100TFif (ref $config{$key} eq "HASH")
2145100TFif (not defined $config{$key} && $config{$key}) { }
2156100TFif (scalar keys %input == 1 and exists $input{'type'} and not ref $input{'type'}) { }
216550TFif (defined(my $re = $output{'matches'}))
21660TFif (ref $re ne "Regexp")
21700TFif ($@) { }
218250TFif (defined(my $re = $output{'nomatch'}))
21830TFif (ref $re ne "Regexp")
21870TFif ($@) { }
2196100TF$new && ref $new eq 'HASH' ? :
2199100TFif (keys %transforms)
2203100TFif ($transforms_code)
2220100TFif (keys %transforms and $config{'properties'}{'enable'} // 0)
2237100TFif (keys %accessor)
224250TFunless (defined $new)
2247100TFif ($type eq "getset")
2248100TFif (scalar keys %input != 1)
2251100TFif (scalar keys %output == 0)
2258100TF$module ? :
2269100TFif (scalar keys %input == 1)
2271100TFref $spec eq 'HASH' ? :
2272100TFif defined $type and not ref $type and $type =~ /^(?:integer|number|float)$/u
2274100TFif (defined $new and defined $module) { }
100TFelsif (defined $module and length $module) { }
2276100TFif ($new_code eq '') { }
2282100TFif ($has_positions) { }
2284100TFif (defined $accessor{'type'})
228550TFif ($accessor{'type'} eq 'getter') { }
50TFelsif ($accessor{'type'} eq 'getset') { }
229250TFif ($accessor{'type'} eq "getset" or $accessor{'type'} eq "getter")
229650TFif ($accessor{'type'} eq "getter")
230150TFif ($output{'_returns_self'})
230750TFif ($output{'_returns_self'}) { }
100TFelsif (defined $accessor{'type'} and $accessor{'type'} eq 'getset') { }
2312100TFif (scalar keys %input == 0)
2313100TFif (defined $accessor{'type'} and $accessor{'type'} eq "getter")
2324100TFif ($function eq 'new' or $function eq 'import' or defined $invocant and $invocant eq 'class' and not defined $new) { }
232550TFif ($has_positions) { }
2331100TFif ($has_positions) { }
2338100TFif ($has_positions) { }
2347100TFif (($output{'type'} // "") eq "array")
234850TFif (defined $call_code)
235150TFif (defined $position_code)
2364100TFif (defined $accessor{'type'} and $accessor{'type'} eq "getter")
2369100TFunless defined $$code
2378100TFunless defined $$code and $config{'check_accessors'} // 1
2389100TFif (defined $accessor{'type'} and $accessor{'type'} eq "getset" and defined $accessor{'property'})
2397100TFunless defined $$code and $config{'check_accessors'} // 1
2404100TFif (%all_cases)
241050TFunless $inputs
241450TFif ($expected_str eq q['_STATUS:DIES']) { }
50TFelsif ($expected_str eq q['_STATUS:WARNS']) { }
242050TFif (ref $inputs eq "HASH")
242450TFif (ref $inputs eq 'ARRAY') { }
0TFelsif (ref $inputs eq 'HASH') { }
243750TFif ($input_str eq "undef" and not $config{'test_undef'})
244050TFif ($new) { }
24410TFif ($status eq 'DIES') { }
0TFelsif ($status eq 'WARNS') { }
24520TFif (($output{'type'} // '') eq 'boolean') { }
24530TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
246550TFif ($status eq 'DIES') { }
50TFelsif ($status eq 'WARNS') { }
24660TFif ($module) { }
24740TFif ($module) { }
248350TFref $inputs eq 'ARRAY' ? :
248650TFif (($output{'type'} // '') eq 'boolean') { }
24870TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
2511100TFif (defined $seed)
2517100TFdefined $position_code ? :
255650TFunless $tt->process($template, $vars, \$test)
2558100TFif ($test_file) { }
256350TFunless open my $fh, ">:encoding(UTF-8)", $test_file
2566100TFif ($module) { }
2593100TFunless defined $name
2662100TFunless defined $schema_file
2664100TFunless length $schema_file
2668100TFunless -r $schema_file
267350TFif (my $schema = "Config::Abstraction"->new("config_dirs", [".", ""], "config_file", $schema_file, "no_fixate", 1))
267850TFif ($schema = $schema->all)
2681100TFif (exists $schema->{$LEGACY_PERL_KEY_1} or exists $schema->{$LEGACY_PERL_KEY_2})
2722100TFunless exists $schema->{$section}
2726100TFif ref $schema->{$section} eq "HASH"
2731100TFif defined $schema->{$section} and $schema->{$section} eq "undef"
2773100TFunless (defined $schema->{'module'} or defined $schema->{'function'})
2779100TFunless (defined $schema->{'input'} or defined $schema->{'output'})
2784100TFif ($schema->{'input'} and ref $schema->{'input'} ne "HASH")
2785100TFif ($schema->{'input'} eq 'undef') { }
2793100TFif ($schema->{'input'})
2800100TFif (exists $schema->{'transforms'} and ref $schema->{'transforms'} eq "HASH")
2805100TFif (ref $schema->{'config'} eq "HASH")
2809100TFunless $VALID_CONFIG_KEYS{$k}
283150TFunless defined $element
283250TFunless (ref $element)
28330TFunless _valid_nested_type($element)
283750TFif ref $element ne "HASH"
2840100TFif ($allow_keys and not exists $element->{'type'})
284250TFunless keys %{$element;}
2845100TFunless (ref $value)
284650TFunless _valid_nested_type($value)
285050TFunless ref $value eq "HASH"
285850TFunless defined $element->{'type'}
2860100TFunless not ref $element->{'type'} and _valid_nested_type($element->{'type'})
2862100TFif $element->{'type'} eq "object" and not defined $element->{'isa'} and not defined $element->{'can'}
2864100TFif ($element->{'type'} eq 'arrayref' or $element->{'type'} eq 'array') { }
50TFelsif ($element->{'type'} eq 'hashref') { }
286750TFif defined $element->{'schema'}
28690TFif defined $element->{'schema'}
287650TFunless defined $type and not ref $type
287750TFif $type eq "array" or $type eq "coderef"
2887100TFunless length $param
2894100TFif (ref $spec eq "HASH" and defined $spec->{'sample_max'})
289650TFunless not ref $spec->{'sample_max'} and $spec->{'sample_max'} =~ /\A\d+(?:\.\d+)?\z/u
2898100TFif defined $spec->{'max'} and $spec->{'sample_max'} > $spec->{'max'}
2900100TFif defined $spec->{'min'} and $spec->{'sample_max'} < $spec->{'min'}
2904100TFif (ref $spec) { }
2906100TFunless defined $spec->{'type'}
291050TFif $spec->{'type'} eq "coderef"
2912100TFunless _valid_type($spec->{'type'})
2914100TFif ($spec->{'type'} eq 'arrayref' or $spec->{'type'} eq 'array') { }
100TFelsif ($spec->{'type'} eq 'hashref') { }
2915100TFif defined $spec->{'schema'}
2917100TFif defined $spec->{'schema'}
292050TFunless _valid_type($spec)
2951100TFunless ref $spec eq "HASH" and defined $spec->{'position'}
2957100TFunless $pos =~ /^\d+$/u
2962100TFif exists $positions{$pos}
2971100TFif ($has_positions)
2974100TFif ref $spec eq "HASH" and defined $spec->{'position'}
2977100TFunless ref $spec eq "HASH" and $spec->{'named'}
2984100TFif ($sorted[$i] != $i)
3012100TFunless ref $spec eq "HASH"
3016100TFif (defined $spec->{'semantic'})
3018100TFunless (exists $semantic_generators->{$semantic})
3027100TFif ($spec->{'enum'} and $spec->{'memberof'})
3033100TFif (exists $spec->{$type})
3035100TFunless ref $spec->{$type} eq "ARRAY"
3064100TFunless exists $transform->{'properties'}
3067100TFunless ref $transform->{'properties'} eq "ARRAY"
3070100TFif (not ref $prop) { }
100TFelsif (ref $prop eq 'HASH') { }
3072100TFunless (exists $builtin_props->{$prop})
3079100TFunless ($prop->{'name'} and $prop->{'code'})
3122100TFif $field eq $CONFIG_PROPERTIES_KEY
3123100TFif $field eq "timeout"
3125100TFif (exists $config->{$field} and defined $config->{$field}) { }
312850TFif (defined(my $b = $Readonly::Values::Boolean::booleans{$config->{$field}}))
3141100TFunless ref $config->{$CONFIG_PROPERTIES_KEY} eq "HASH"
3173100TFunless defined $type
3214100TFunless defined $name and length $name
3218100TF$opts{'package'} ? :
3221100TFunless $name =~ /$re/u
3278100TFunless $module
3283100TFif ($schema_file and not $mod_info)
329850TFif ($verbose)
33040TFif ($mod_info) { }
3318100TFif ($ENV{$ENV_VALIDATE_LOAD})
332150TFunless ($loaded)
333050TFif ($verbose)
3393100TFunless defined $v
346950TFunless defined $value
3470100TFref $value eq 'HASH' ? :
3483100TFunless $href and ref $href eq "HASH"
3493100TFunless (defined $def and ref $def eq "HASH")
3494100TFif (defined $def and not ref $def and _valid_type($def)) { }
3507100TFunless defined $def->{$subk}
3512100TFif (ref $def->{$subk})
351350TFunless (ref $def->{$subk} eq "ARRAY" or ref $def->{$subk} eq "Regexp" or ref $def->{$subk} eq "HASH")
3527100TFif ($subk eq $KEY_MATCHES or $subk eq $KEY_NOMATCH) { }
100TFelsif (ref $def->{$subk} eq 'HASH') { }
3530100TFref $def->{$subk} eq 'Regexp' ? :
353150TFif ($@ or not defined $re)
3614100TFif (ref $value eq "HASH" and ($value->{'_path'} // "") =~ /^(?:file|directory)$/u)
361650TFif $value->{'_path'} eq "directory"
3622100TFif (ref $value eq "ARRAY")
362650TFif (ref $value eq "HASH" and ref $value->{'_stub'} eq "HASH")
3651100TFunless $href and ref $href eq "HASH"
3714100TFunless $href and ref $href eq "HASH"
3722100TFunless ref $aref eq "ARRAY"
3759100TFunless defined $input_spec and ref $input_spec eq "HASH"
3764100TFunless ref $input_spec->{$field} eq "HASH"
3767100TFif defined $input_spec->{$field}{'position'}
379950TFif ref $s
3808100TFunless defined $s
3816100TFunless $s =~ /\Q$l\E|\Q$r\E/u
3824100TFif index($s, $d) == $INDEX_NOT_FOUND
385950TFif ref $s
3863100TFunless defined $s
3929100TFif $depth > 100
3932100TFunless defined $v
3936100TFif $v eq "true"
3937100TFif $v eq "false"
3939100TFif (ref $v)
3941100TFif (ref $v eq "ARRAY")
3947100TFif (ref $v eq "Regexp")
3952100TFif $mods
3963100TF&looks_like_number($v) ? :
4034100TFif (not defined $input_spec or not ref $input_spec and $input_spec eq "undef")
4043100TFunless ref $input_spec eq "HASH"
405950TFif (exists $transform->{'properties'} and ref $transform->{'properties'} eq "ARRAY")
407650TFunless @all_props
408850TFunless ref $spec eq "HASH"
409750TFif (defined $gen and length $gen)
4112100TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
412750TFif (_has_positions($input_spec)) { }
4620100TFunless defined $spec and ref $spec eq "HASH"
4630100TFif ($type eq "string" and defined $spec->{'semantic'})
463450TFif (exists $generators->{$semantic_type}) { }
4654100TFif ($type eq "integer")
4658100TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
100TFelsif (not defined $max) { }
4677100TFif ($type eq "number" or $type eq "float")
4681100TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
100TFelsif (not defined $max) { }
4687100TFif ($max == $ZERO_BOUNDARY) { }
100TFelsif ($max > $ZERO_BOUNDARY) { }
4700100TFif ($min == $ZERO_BOUNDARY) { }
100TFelsif ($min > $ZERO_BOUNDARY) { }
4714100TFif ($range <= $ZERO_BOUNDARY)
4727100TFif ($type eq "string")
4733100TFif (defined $spec->{'matches'})
4743100TFref $pattern eq 'Regexp' ? :
474450TFif ($@ or not defined $compiled)
4751100TFif (defined $spec->{'max'}) { }
100TFelsif (defined $spec->{'min'}) { }
4766100TFif ($type eq "boolean")
4773100TFif ($type eq "arrayref")
4784100TFif ($type eq "hashref")
4916100TFunless defined $spec and ref $spec eq "HASH"
4920100TFif defined $spec->{'type'}
4925100TFunless ref $spec->{$field} eq "HASH"
4927100TFif defined $spec->{$field}{'type'}
4969100TFunless defined $properties and ref $properties eq "ARRAY"
4970100TFunless @{$properties;}
4982100TFif ($prop->{'should_die'}) { }
5044100TFunless defined $input_spec
5045100TFif not ref $input_spec and $input_spec eq "undef"
5054100TFif (_is_numeric_transform($input_spec, $output_spec))
5055100TFif (defined $output_spec->{'min'})
5063100TFif (defined $output_spec->{'max'})
5073100TFif ($transform_name =~ /$TRANSFORM_POSITIVE_PATTERN/iu)
5084100TFif (defined $output_spec->{'value'})
508950TFref $expected ? :
5100100TFif (_is_string_transform($input_spec, $output_spec))
5101100TFif (defined $output_spec->{'min'})
510850TFif (defined $output_spec->{'max'})
511550TFif (defined $output_spec->{'matches'})
51220TFref $pattern eq 'Regexp' ? :
51230TFif ($@ or not defined $compiled) { }
5139100TFif (_same_type($input_spec, $output_spec))
5144100TFif ($type eq "number" or $type eq "integer" or $type eq "float")
5158100TFunless (($output_spec->{'type'} // "") eq "undef")
5224100TFif (not ref $prop_def) { }
100TFelsif (ref $prop_def eq 'HASH') { }
5228100TFunless (exists $builtin_properties->{$prop_name})
523850TFif (_has_positions($input_spec)) { }
525150TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
5275100TFunless ($prop_code)
528250TFunless ($prop_code =~ /\$/u or $prop_code =~ /\w+/u)