Branch Coverage

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

line%coveragebranch
157050TFif scalar @_ == 0
157650TFref $_[0] ne 'HASH' ? :
1582100TFif (ref $_[0] eq 'HASH' or defined $_[2]) { }
1594100TFif ($params->{'schema_file'}) { }
100TFelsif ($params->{'input_file'}) { }
50TFelsif ($params->{'schema'}) { }
1603100TFif (defined $schema_file)
1610100TFif (defined $schema_file) { }
1623100TFif exists $schema->{'cases'}
162450TFif exists $schema->{'edge_cases'}
1625100TFif exists $schema->{'type_edge_cases'}
1627100TFif exists $schema->{'module'} and length $schema->{'module'}
1628100TFif exists $schema->{'function'}
1629100TFif (exists $schema->{'new'})
1630100TFdefined $schema->{'new'} ? :
1632100TFif exists $schema->{'yaml_cases'}
1633100TFif exists $schema->{'seed'}
1634100TFif exists $schema->{'iterations'}
1636100TFif exists $schema->{'edge_case_array'}
1639100TFif exists $schema->{'config'}
1644100TFif (not $module) { }
100TFelsif ($module eq $MODULE_BUILTIN) { }
164550TFif ($schema_file)
16500TFif (_is_perl_builtin($module))
165850TFif ($module and length $module and $module ne "builtin")
1665100TFif defined $module and length $module
167450TFif defined $seed and $seed eq ""
1678100TFif (defined $yaml_cases)
1679100TFunless -f $yaml_cases
168250TFif ($yaml_data and ref $yaml_data eq "HASH")
1688100TFunless ($outputs and ref $outputs eq "ARRAY")
170150TFif (exists $cases{$k} and ref $cases{$k} eq "ARRAY" and ref $yaml_corpus_data{$k} eq "ARRAY")
1706100TFif (my $hints = delete $schema->{'_yamltest_hints'})
170750TFif (my $boundaries = $hints->{'boundary_values'})
171050TFif (my $invalid = $hints->{'invalid'})
171650TFif ($schema->{'type'} and $schema->{'type'} =~ /^(integer|number|float)$/u)
17180TFunless defined $_
17190TFif &Scalar::Util::looks_like_number($_)
172750TFif (exists $schema->{'relationships'} and ref $schema->{'relationships'} eq "ARRAY")
17420TFif ($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') { }
1789100TF&Scalar::Util::looks_like_number($_) ? :
50TFdefined $_ ? :
179550TFunless defined $a
179650TFunless defined $b
1801100TFif $na and $nb
180250TFif $na
180350TFif $nb
1812100TFif (scalar @edge_case_array)
1821100TFif (ref $config{$key} eq "HASH")
1824100TFif (not defined $config{$key} && $config{$key}) { }
1835100TFif (scalar keys %input == 1 and exists $input{'type'} and not ref $input{'type'}) { }
184450TFif (defined(my $re = $output{'matches'}))
18450TFif (ref $re ne "Regexp")
18490TFif ($@) { }
186150TFif (defined(my $re = $output{'nomatch'}))
18620TFif (ref $re ne "Regexp")
18660TFif ($@) { }
1875100TF$new && ref $new eq 'HASH' ? :
1878100TFif (keys %transforms)
1882100TFif ($transforms_code)
1899100TFif (keys %transforms and $config{'properties'}{'enable'} // 0)
1916100TFif (keys %accessor)
192150TFunless (defined $new)
192450TFif ($type eq "getset")
19250TFif (scalar keys %input != 1)
19280TFif (scalar keys %output == 0)
1935100TF$module ? :
1939100TFif (defined $new and defined $module) { }
100TFelsif (defined $module and length $module) { }
1941100TFif ($new_code eq '') { }
1947100TFif ($has_positions) { }
194950TFif (defined $accessor{'type'})
19500TFif ($accessor{'type'} eq 'getter') { }
0TFelsif ($accessor{'type'} eq 'getset') { }
19570TFif ($accessor{'type'} eq "getset" or $accessor{'type'} eq "getter")
19610TFif ($accessor{'type'} eq "getter")
19660TFif ($output{'_returns_self'})
197250TFif ($output{'_returns_self'}) { }
50TFelsif (defined $accessor{'type'} and $accessor{'type'} eq 'getset') { }
1977100TFif (scalar keys %input == 0)
1978100TFif (defined $accessor{'type'} and $accessor{'type'} eq "getter")
1984100TFif ($function eq 'new') { }
198550TFif ($has_positions) { }
199150TFif ($has_positions) { }
1998100TFif ($has_positions) { }
2007100TFif (($output{'type'} // "") eq "array")
200850TFif (defined $call_code)
201150TFif (defined $position_code)
2018100TFif (%all_cases)
202450TFunless $inputs
202850TFif ($expected_str eq q['_STATUS:DIES']) { }
50TFelsif ($expected_str eq q['_STATUS:WARNS']) { }
203450TFif (ref $inputs eq "HASH")
203850TFif (ref $inputs eq 'ARRAY') { }
0TFelsif (ref $inputs eq 'HASH') { }
205150TFif ($input_str eq "undef" and not $config{'test_undef'})
205450TFif ($new) { }
20550TFif ($status eq 'DIES') { }
0TFelsif ($status eq 'WARNS') { }
20660TFif (($output{'type'} // '') eq 'boolean') { }
20670TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
207950TFif ($status eq 'DIES') { }
50TFelsif ($status eq 'WARNS') { }
20800TFif ($module) { }
20880TFif ($module) { }
209750TFref $inputs eq 'ARRAY' ? :
210050TFif (($output{'type'} // '') eq 'boolean') { }
21010TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
2118100TFif (defined $seed)
2124100TFdefined $position_code ? :
216050TFunless $tt->process($template, $vars, \$test)
2162100TFif ($test_file) { }
216750TFunless open my $fh, ">:encoding(UTF-8)", $test_file
2170100TFif ($module) { }
2195100TFunless defined $name
2264100TFunless defined $schema_file
2266100TFunless length $schema_file
2270100TFunless -r $schema_file
227550TFif (my $schema = "Config::Abstraction"->new("config_dirs", [".", ""], "config_file", $schema_file, "no_fixate", 1))
228050TFif ($schema = $schema->all)
2283100TFif (exists $schema->{$LEGACY_PERL_KEY_1} or exists $schema->{$LEGACY_PERL_KEY_2})
2324100TFunless exists $schema->{$section}
2328100TFif ref $schema->{$section} eq "HASH"
2333100TFif defined $schema->{$section} and $schema->{$section} eq "undef"
2375100TFunless (defined $schema->{'module'} or defined $schema->{'function'})
2381100TFunless (defined $schema->{'input'} or defined $schema->{'output'})
2386100TFif ($schema->{'input'} and ref $schema->{'input'} ne "HASH")
2387100TFif ($schema->{'input'} eq 'undef') { }
2395100TFif ($schema->{'input'})
2402100TFif (exists $schema->{'transforms'} and ref $schema->{'transforms'} eq "HASH")
2407100TFif (ref $schema->{'config'} eq "HASH")
2411100TFunless grep {$_ eq $k;} ('test_nuls', 'test_undef', 'test_empty', 'test_non_ascii', 'dedup', 'properties', 'close_stdin', 'test_security', 'timeout')
2433100TFunless length $param
2439100TFif (ref $spec) { }
2441100TFunless defined $spec->{'type'}
244350TFif $spec->{'type'} eq "coderef"
2445100TFunless _valid_type($spec->{'type'})
244750TFunless _valid_type($spec)
2478100TFunless ref $spec eq "HASH" and defined $spec->{'position'}
2484100TFunless $pos =~ /^\d+$/u
2489100TFif exists $positions{$pos}
2495100TFif ($has_positions)
2498100TFunless (ref $spec eq "HASH" and defined $spec->{'position'})
2508100TFif ($sorted[$i] != $i)
2536100TFunless ref $spec eq "HASH"
2540100TFif (defined $spec->{'semantic'})
2542100TFunless (exists $semantic_generators->{$semantic})
2551100TFif ($spec->{'enum'} and $spec->{'memberof'})
2557100TFif (exists $spec->{$type})
2559100TFunless ref $spec->{$type} eq "ARRAY"
2588100TFunless exists $transform->{'properties'}
2591100TFunless ref $transform->{'properties'} eq "ARRAY"
2594100TFif (not ref $prop) { }
100TFelsif (ref $prop eq 'HASH') { }
2596100TFunless (exists $builtin_props->{$prop})
2603100TFunless ($prop->{'name'} and $prop->{'code'})
2646100TFif $field eq $CONFIG_PROPERTIES_KEY
2647100TFif $field eq "timeout"
2649100TFif (exists $config->{$field} and defined $config->{$field}) { }
265250TFif (defined(my $b = $Readonly::Values::Boolean::booleans{$config->{$field}}))
2665100TFunless ref $config->{$CONFIG_PROPERTIES_KEY} eq "HASH"
2697100TFunless defined $type
2738100TFunless defined $name and length $name
2742100TF$opts{'package'} ? :
2745100TFunless $name =~ /$re/u
2802100TFunless $module
2807100TFif ($schema_file and not $mod_info)
282250TFif ($verbose)
283150TFif ($ENV{$ENV_VALIDATE_LOAD})
28340TFunless ($loaded)
28430TFif ($verbose)
2904100TFunless defined $v
2979100TFunless $href and ref $href eq "HASH"
2989100TFunless (defined $def and ref $def eq "HASH")
2990100TFif (defined $def and not ref $def and _valid_type($def)) { }
3003100TFunless defined $def->{$subk}
300750TFif (ref $def->{$subk})
30080TFunless (ref $def->{$subk} eq "ARRAY" or ref $def->{$subk} eq "Regexp")
3021100TFif ($subk eq $KEY_MATCHES or $subk eq $KEY_NOMATCH) { }
302450TFref $def->{$subk} eq 'Regexp' ? :
302550TFif ($@ or not defined $re)
3092100TFunless $href and ref $href eq "HASH"
3152100TFunless $href and ref $href eq "HASH"
3160100TFunless ref $aref eq "ARRAY"
3197100TFunless defined $input_spec and ref $input_spec eq "HASH"
3202100TFunless ref $input_spec->{$field} eq "HASH"
3205100TFif defined $input_spec->{$field}{'position'}
323750TFif ref $s
3246100TFunless defined $s
3254100TFunless $s =~ /\Q$l\E|\Q$r\E/u
3262100TFif index($s, $d) == $INDEX_NOT_FOUND
329750TFif ref $s
3301100TFunless defined $s
3364100TFif $depth > 100
3367100TFunless defined $v
3371100TFif $v eq "true"
3372100TFif $v eq "false"
3374100TFif (ref $v)
3376100TFif (ref $v eq "ARRAY")
3382100TFif (ref $v eq "Regexp")
3387100TFif $mods
3398100TF&looks_like_number($v) ? :
3469100TFif (not defined $input_spec or not ref $input_spec and $input_spec eq "undef")
3478100TFunless ref $input_spec eq "HASH"
349450TFif (exists $transform->{'properties'} and ref $transform->{'properties'} eq "ARRAY")
351150TFunless @all_props
352350TFunless ref $spec eq "HASH"
353250TFif (defined $gen and length $gen)
3547100TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
356250TFif (_has_positions($input_spec)) { }
4068100TFunless defined $spec and ref $spec eq "HASH"
4078100TFif ($type eq "string" and defined $spec->{'semantic'})
408250TFif (exists $generators->{$semantic_type}) { }
4102100TFif ($type eq "integer")
4106100TFif (not defined $min || defined $max) { }
50TFelsif (not defined $min) { }
50TFelsif (not defined $max) { }
4125100TFif ($type eq "number" or $type eq "float")
4129100TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
100TFelsif (not defined $max) { }
413550TFif ($max == $ZERO_BOUNDARY) { }
0TFelsif ($max > $ZERO_BOUNDARY) { }
414850TFif ($min == $ZERO_BOUNDARY) { }
0TFelsif ($min > $ZERO_BOUNDARY) { }
416250TFif ($range <= $ZERO_BOUNDARY)
4175100TFif ($type eq "string")
4181100TFif (defined $spec->{'matches'})
419150TFref $pattern eq 'Regexp' ? :
419250TFif ($@ or not defined $compiled)
419950TFif (defined $spec->{'max'}) { }
50TFelsif (defined $spec->{'min'}) { }
4214100TFif ($type eq "boolean")
4221100TFif ($type eq "arrayref")
423250TFif ($type eq "hashref")
4364100TFunless defined $spec and ref $spec eq "HASH"
4368100TFif defined $spec->{'type'}
4373100TFunless ref $spec->{$field} eq "HASH"
4375100TFif defined $spec->{$field}{'type'}
4417100TFunless defined $properties and ref $properties eq "ARRAY"
4418100TFunless @{$properties;}
4430100TFif ($prop->{'should_die'}) { }
4492100TFunless defined $input_spec
4493100TFif not ref $input_spec and $input_spec eq "undef"
4502100TFif (_is_numeric_transform($input_spec, $output_spec))
4503100TFif (defined $output_spec->{'min'})
4511100TFif (defined $output_spec->{'max'})
4521100TFif ($transform_name =~ /$TRANSFORM_POSITIVE_PATTERN/iu)
4532100TFif (defined $output_spec->{'value'})
453750TFref $expected ? :
4548100TFif (_is_string_transform($input_spec, $output_spec))
4549100TFif (defined $output_spec->{'min'})
455650TFif (defined $output_spec->{'max'})
456350TFif (defined $output_spec->{'matches'})
45700TFref $pattern eq 'Regexp' ? :
45710TFif ($@ or not defined $compiled) { }
4587100TFif (_same_type($input_spec, $output_spec))
4592100TFif ($type eq "number" or $type eq "integer" or $type eq "float")
4606100TFunless (($output_spec->{'type'} // "") eq "undef")
4672100TFif (not ref $prop_def) { }
100TFelsif (ref $prop_def eq 'HASH') { }
4676100TFunless (exists $builtin_properties->{$prop_name})
468650TFif (_has_positions($input_spec)) { }
469750TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
4721100TFunless ($prop_code)
472850TFunless ($prop_code =~ /\$/u or $prop_code =~ /\w+/u)