Branch Coverage

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

line%coveragebranch
162850TFif scalar @_ == 0
163450TFref $_[0] ne 'HASH' ? :
1640100TFif (ref $_[0] eq 'HASH' or defined $_[2]) { }
1652100TFif ($params->{'schema_file'}) { }
100TFelsif ($params->{'input_file'}) { }
50TFelsif ($params->{'schema'}) { }
1661100TFif (defined $schema_file)
1668100TFif (defined $schema_file) { }
1681100TFif exists $schema->{'cases'}
168250TFif exists $schema->{'edge_cases'}
1683100TFif exists $schema->{'type_edge_cases'}
1685100TFif exists $schema->{'module'} and length $schema->{'module'}
1686100TFif exists $schema->{'function'}
1687100TFif (exists $schema->{'new'})
1688100TFdefined $schema->{'new'} ? :
1690100TFif exists $schema->{'yaml_cases'}
1691100TFif exists $schema->{'seed'}
1692100TFif exists $schema->{'iterations'}
1694100TFif exists $schema->{'edge_case_array'}
1697100TFif exists $schema->{'config'}
1702100TFif (not $module) { }
100TFelsif ($module eq $MODULE_BUILTIN) { }
1703100TFif ($schema_file)
1708100TFif (_is_perl_builtin($module))
171650TFif ($module and length $module and $module ne "builtin")
1723100TFif defined $module and length $module
173250TFif defined $seed and $seed eq ""
1736100TFif (defined $yaml_cases)
1737100TFunless -f $yaml_cases
174050TFif ($yaml_data and ref $yaml_data eq "HASH")
1746100TFunless ($outputs and ref $outputs eq "ARRAY")
175950TFif (exists $cases{$k} and ref $cases{$k} eq "ARRAY" and ref $yaml_corpus_data{$k} eq "ARRAY")
1764100TFif (my $hints = delete $schema->{'_yamltest_hints'})
176550TFif (my $boundaries = $hints->{'boundary_values'})
176850TFif (my $invalid = $hints->{'invalid'})
1774100TFif ($schema->{'type'} and $schema->{'type'} =~ /^(integer|number|float)$/u)
177650TFunless defined $_
1777100TFif &Scalar::Util::looks_like_number($_)
178550TFif (exists $schema->{'relationships'} and ref $schema->{'relationships'} eq "ARRAY")
18000TFif ($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') { }
1847100TF&Scalar::Util::looks_like_number($_) ? :
50TFdefined $_ ? :
185350TFunless defined $a
185450TFunless defined $b
1859100TFif $na and $nb
1860100TFif $na
1861100TFif $nb
1870100TFif (scalar @edge_case_array)
1879100TFif (ref $config{$key} eq "HASH")
1882100TFif (not defined $config{$key} && $config{$key}) { }
1893100TFif (scalar keys %input == 1 and exists $input{'type'} and not ref $input{'type'}) { }
190250TFif (defined(my $re = $output{'matches'}))
19030TFif (ref $re ne "Regexp")
19070TFif ($@) { }
191950TFif (defined(my $re = $output{'nomatch'}))
19200TFif (ref $re ne "Regexp")
19240TFif ($@) { }
1933100TF$new && ref $new eq 'HASH' ? :
1936100TFif (keys %transforms)
1940100TFif ($transforms_code)
1957100TFif (keys %transforms and $config{'properties'}{'enable'} // 0)
1974100TFif (keys %accessor)
197950TFunless (defined $new)
1984100TFif ($type eq "getset")
1985100TFif (scalar keys %input != 1)
1988100TFif (scalar keys %output == 0)
1995100TF$module ? :
1999100TFif (defined $new and defined $module) { }
100TFelsif (defined $module and length $module) { }
2001100TFif ($new_code eq '') { }
2007100TFif ($has_positions) { }
200950TFif (defined $accessor{'type'})
20100TFif ($accessor{'type'} eq 'getter') { }
0TFelsif ($accessor{'type'} eq 'getset') { }
20170TFif ($accessor{'type'} eq "getset" or $accessor{'type'} eq "getter")
20210TFif ($accessor{'type'} eq "getter")
20260TFif ($output{'_returns_self'})
203250TFif ($output{'_returns_self'}) { }
100TFelsif (defined $accessor{'type'} and $accessor{'type'} eq 'getset') { }
2037100TFif (scalar keys %input == 0)
2038100TFif (defined $accessor{'type'} and $accessor{'type'} eq "getter")
2044100TFif ($function eq 'new') { }
204550TFif ($has_positions) { }
2051100TFif ($has_positions) { }
2058100TFif ($has_positions) { }
2067100TFif (($output{'type'} // "") eq "array")
206850TFif (defined $call_code)
207150TFif (defined $position_code)
2078100TFif (%all_cases)
208450TFunless $inputs
208850TFif ($expected_str eq q['_STATUS:DIES']) { }
50TFelsif ($expected_str eq q['_STATUS:WARNS']) { }
209450TFif (ref $inputs eq "HASH")
209850TFif (ref $inputs eq 'ARRAY') { }
0TFelsif (ref $inputs eq 'HASH') { }
211150TFif ($input_str eq "undef" and not $config{'test_undef'})
211450TFif ($new) { }
21150TFif ($status eq 'DIES') { }
0TFelsif ($status eq 'WARNS') { }
21260TFif (($output{'type'} // '') eq 'boolean') { }
21270TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
213950TFif ($status eq 'DIES') { }
50TFelsif ($status eq 'WARNS') { }
21400TFif ($module) { }
21480TFif ($module) { }
215750TFref $inputs eq 'ARRAY' ? :
216050TFif (($output{'type'} // '') eq 'boolean') { }
21610TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
2178100TFif (defined $seed)
2184100TFdefined $position_code ? :
222050TFunless $tt->process($template, $vars, \$test)
2222100TFif ($test_file) { }
222750TFunless open my $fh, ">:encoding(UTF-8)", $test_file
2230100TFif ($module) { }
2255100TFunless defined $name
2324100TFunless defined $schema_file
2326100TFunless length $schema_file
2330100TFunless -r $schema_file
233550TFif (my $schema = "Config::Abstraction"->new("config_dirs", [".", ""], "config_file", $schema_file, "no_fixate", 1))
234050TFif ($schema = $schema->all)
2343100TFif (exists $schema->{$LEGACY_PERL_KEY_1} or exists $schema->{$LEGACY_PERL_KEY_2})
2384100TFunless exists $schema->{$section}
2388100TFif ref $schema->{$section} eq "HASH"
2393100TFif defined $schema->{$section} and $schema->{$section} eq "undef"
2435100TFunless (defined $schema->{'module'} or defined $schema->{'function'})
2441100TFunless (defined $schema->{'input'} or defined $schema->{'output'})
2446100TFif ($schema->{'input'} and ref $schema->{'input'} ne "HASH")
2447100TFif ($schema->{'input'} eq 'undef') { }
2455100TFif ($schema->{'input'})
2462100TFif (exists $schema->{'transforms'} and ref $schema->{'transforms'} eq "HASH")
2467100TFif (ref $schema->{'config'} eq "HASH")
2471100TFunless $VALID_CONFIG_KEYS{$k}
2493100TFunless length $param
2499100TFif (ref $spec) { }
2501100TFunless defined $spec->{'type'}
250350TFif $spec->{'type'} eq "coderef"
2505100TFunless _valid_type($spec->{'type'})
250750TFunless _valid_type($spec)
2538100TFunless ref $spec eq "HASH" and defined $spec->{'position'}
2544100TFunless $pos =~ /^\d+$/u
2549100TFif exists $positions{$pos}
2555100TFif ($has_positions)
2558100TFunless (ref $spec eq "HASH" and defined $spec->{'position'})
2568100TFif ($sorted[$i] != $i)
2596100TFunless ref $spec eq "HASH"
2600100TFif (defined $spec->{'semantic'})
2602100TFunless (exists $semantic_generators->{$semantic})
2611100TFif ($spec->{'enum'} and $spec->{'memberof'})
2617100TFif (exists $spec->{$type})
2619100TFunless ref $spec->{$type} eq "ARRAY"
2648100TFunless exists $transform->{'properties'}
2651100TFunless ref $transform->{'properties'} eq "ARRAY"
2654100TFif (not ref $prop) { }
100TFelsif (ref $prop eq 'HASH') { }
2656100TFunless (exists $builtin_props->{$prop})
2663100TFunless ($prop->{'name'} and $prop->{'code'})
2706100TFif $field eq $CONFIG_PROPERTIES_KEY
2707100TFif $field eq "timeout"
2709100TFif (exists $config->{$field} and defined $config->{$field}) { }
271250TFif (defined(my $b = $Readonly::Values::Boolean::booleans{$config->{$field}}))
2725100TFunless ref $config->{$CONFIG_PROPERTIES_KEY} eq "HASH"
2757100TFunless defined $type
2798100TFunless defined $name and length $name
2802100TF$opts{'package'} ? :
2805100TFunless $name =~ /$re/u
2862100TFunless $module
2867100TFif ($schema_file and not $mod_info)
288250TFif ($verbose)
2891100TFif ($ENV{$ENV_VALIDATE_LOAD})
289450TFunless ($loaded)
290350TFif ($verbose)
2964100TFunless defined $v
3035100TFunless $href and ref $href eq "HASH"
3045100TFunless (defined $def and ref $def eq "HASH")
3046100TFif (defined $def and not ref $def and _valid_type($def)) { }
3059100TFunless defined $def->{$subk}
306350TFif (ref $def->{$subk})
30640TFunless (ref $def->{$subk} eq "ARRAY" or ref $def->{$subk} eq "Regexp")
3077100TFif ($subk eq $KEY_MATCHES or $subk eq $KEY_NOMATCH) { }
308050TFref $def->{$subk} eq 'Regexp' ? :
308150TFif ($@ or not defined $re)
3148100TFunless $href and ref $href eq "HASH"
3208100TFunless $href and ref $href eq "HASH"
3216100TFunless ref $aref eq "ARRAY"
3253100TFunless defined $input_spec and ref $input_spec eq "HASH"
3258100TFunless ref $input_spec->{$field} eq "HASH"
3261100TFif defined $input_spec->{$field}{'position'}
329350TFif ref $s
3302100TFunless defined $s
3310100TFunless $s =~ /\Q$l\E|\Q$r\E/u
3318100TFif index($s, $d) == $INDEX_NOT_FOUND
335350TFif ref $s
3357100TFunless defined $s
3421100TFif $depth > 100
3424100TFunless defined $v
3428100TFif $v eq "true"
3429100TFif $v eq "false"
3431100TFif (ref $v)
3433100TFif (ref $v eq "ARRAY")
3439100TFif (ref $v eq "Regexp")
3444100TFif $mods
3455100TF&looks_like_number($v) ? :
3526100TFif (not defined $input_spec or not ref $input_spec and $input_spec eq "undef")
3535100TFunless ref $input_spec eq "HASH"
355150TFif (exists $transform->{'properties'} and ref $transform->{'properties'} eq "ARRAY")
356850TFunless @all_props
358050TFunless ref $spec eq "HASH"
358950TFif (defined $gen and length $gen)
3604100TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
361950TFif (_has_positions($input_spec)) { }
4084100TFunless defined $spec and ref $spec eq "HASH"
4094100TFif ($type eq "string" and defined $spec->{'semantic'})
409850TFif (exists $generators->{$semantic_type}) { }
4118100TFif ($type eq "integer")
4122100TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
100TFelsif (not defined $max) { }
4141100TFif ($type eq "number" or $type eq "float")
4145100TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
100TFelsif (not defined $max) { }
4151100TFif ($max == $ZERO_BOUNDARY) { }
100TFelsif ($max > $ZERO_BOUNDARY) { }
4164100TFif ($min == $ZERO_BOUNDARY) { }
100TFelsif ($min > $ZERO_BOUNDARY) { }
4178100TFif ($range <= $ZERO_BOUNDARY)
4191100TFif ($type eq "string")
4197100TFif (defined $spec->{'matches'})
4207100TFref $pattern eq 'Regexp' ? :
420850TFif ($@ or not defined $compiled)
4215100TFif (defined $spec->{'max'}) { }
100TFelsif (defined $spec->{'min'}) { }
4230100TFif ($type eq "boolean")
4237100TFif ($type eq "arrayref")
4248100TFif ($type eq "hashref")
4380100TFunless defined $spec and ref $spec eq "HASH"
4384100TFif defined $spec->{'type'}
4389100TFunless ref $spec->{$field} eq "HASH"
4391100TFif defined $spec->{$field}{'type'}
4433100TFunless defined $properties and ref $properties eq "ARRAY"
4434100TFunless @{$properties;}
4446100TFif ($prop->{'should_die'}) { }
4508100TFunless defined $input_spec
4509100TFif not ref $input_spec and $input_spec eq "undef"
4518100TFif (_is_numeric_transform($input_spec, $output_spec))
4519100TFif (defined $output_spec->{'min'})
4527100TFif (defined $output_spec->{'max'})
4537100TFif ($transform_name =~ /$TRANSFORM_POSITIVE_PATTERN/iu)
4548100TFif (defined $output_spec->{'value'})
455350TFref $expected ? :
4564100TFif (_is_string_transform($input_spec, $output_spec))
4565100TFif (defined $output_spec->{'min'})
457250TFif (defined $output_spec->{'max'})
457950TFif (defined $output_spec->{'matches'})
45860TFref $pattern eq 'Regexp' ? :
45870TFif ($@ or not defined $compiled) { }
4603100TFif (_same_type($input_spec, $output_spec))
4608100TFif ($type eq "number" or $type eq "integer" or $type eq "float")
4622100TFunless (($output_spec->{'type'} // "") eq "undef")
4688100TFif (not ref $prop_def) { }
100TFelsif (ref $prop_def eq 'HASH') { }
4692100TFunless (exists $builtin_properties->{$prop_name})
470250TFif (_has_positions($input_spec)) { }
471350TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
4737100TFunless ($prop_code)
474450TFunless ($prop_code =~ /\$/u or $prop_code =~ /\w+/u)