Branch Coverage

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

line%coveragebranch
1538100TFif scalar @_ <= 1
1548100TFif (ref $args eq 'HASH' or defined $_[2]) { }
1560100TFif ($params->{'schema_file'}) { }
100TFelsif ($params->{'input_file'}) { }
50TFelsif ($params->{'schema'}) { }
1569100TFif (defined $schema_file)
1576100TFif (defined $schema_file) { }
1589100TFif exists $schema->{'cases'}
159050TFif exists $schema->{'edge_cases'}
1591100TFif exists $schema->{'type_edge_cases'}
1593100TFif exists $schema->{'module'} and length $schema->{'module'}
1594100TFif exists $schema->{'function'}
1595100TFif (exists $schema->{'new'})
1596100TFdefined $schema->{'new'} ? :
1598100TFif exists $schema->{'yaml_cases'}
1599100TFif exists $schema->{'seed'}
1600100TFif exists $schema->{'iterations'}
1602100TFif exists $schema->{'edge_case_array'}
1605100TFif exists $schema->{'config'}
161050TFif (not $module) { }
100TFelsif ($module eq $MODULE_BUILTIN) { }
16110TFif ($schema_file)
16160TFif (_is_perl_builtin($module))
162450TFif ($module and length $module and $module ne "builtin")
163150TFif defined $seed and $seed eq ""
1635100TFif (defined $yaml_cases)
1636100TFunless -f $yaml_cases
163950TFif ($yaml_data and ref $yaml_data eq "HASH")
1645100TFunless ($outputs and ref $outputs eq "ARRAY")
165850TFif (exists $cases{$k} and ref $cases{$k} eq "ARRAY" and ref $yaml_corpus_data{$k} eq "ARRAY")
1663100TFif (my $hints = delete $schema->{'_yamltest_hints'})
166450TFif (my $boundaries = $hints->{'boundary_values'})
166750TFif (my $invalid = $hints->{'invalid'})
167350TFif ($schema->{'type'} and $schema->{'type'} =~ /^(integer|number|float)$/u)
16750TFunless defined $_
16760TFif &Scalar::Util::looks_like_number($_)
168450TFif (exists $schema->{'relationships'} and ref $schema->{'relationships'} eq "ARRAY")
16990TFif ($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') { }
1746100TF&Scalar::Util::looks_like_number($_) ? :
50TFdefined $_ ? :
175250TFunless defined $a
175350TFunless defined $b
1758100TFif $na and $nb
175950TFif $na
176050TFif $nb
1769100TFif (scalar @edge_case_array)
1778100TFif (ref $config{$key} eq "HASH")
1781100TFif (not defined $config{$key} && $config{$key}) { }
1792100TFif (scalar keys %input == 1 and exists $input{'type'} and not ref $input{'type'}) { }
180150TFif (defined(my $re = $output{'matches'}))
18020TFif (ref $re ne "Regexp")
18060TFif ($@) { }
181850TFif (defined(my $re = $output{'nomatch'}))
18190TFif (ref $re ne "Regexp")
18230TFif ($@) { }
1832100TF$new && ref $new eq 'HASH' ? :
1835100TFif (keys %transforms)
1839100TFif ($transforms_code)
1856100TFif (keys %transforms and $config{'properties'}{'enable'} // 0)
1873100TFif (keys %accessor)
187850TFunless (defined $new)
188150TFif ($type eq "getset")
18820TFif (scalar keys %input != 1)
18850TFif (scalar keys %output == 0)
1892100TF$module ? :
1896100TFif (defined $new and defined $module) { }
100TFelsif (defined $module and length $module) { }
1898100TFif ($new_code eq '') { }
1904100TFif ($has_positions) { }
190650TFif (defined $accessor{'type'})
19070TFif ($accessor{'type'} eq 'getter') { }
0TFelsif ($accessor{'type'} eq 'getset') { }
19140TFif ($accessor{'type'} eq "getset" or $accessor{'type'} eq "getter")
19180TFif ($accessor{'type'} eq "getter")
19230TFif ($output{'_returns_self'})
192950TFif ($output{'_returns_self'}) { }
50TFelsif (defined $accessor{'type'} and $accessor{'type'} eq 'getset') { }
1934100TFif (scalar keys %input == 0)
193550TFif (defined $accessor{'type'} and $accessor{'type'} eq "getter")
1941100TFif ($function eq 'new') { }
194250TFif ($has_positions) { }
194850TFif ($has_positions) { }
1955100TFif ($has_positions) { }
1964100TFif (%all_cases)
197050TFunless $inputs
197450TFif ($expected_str eq q['_STATUS:DIES']) { }
50TFelsif ($expected_str eq q['_STATUS:WARNS']) { }
198050TFif (ref $inputs eq "HASH")
198450TFif (ref $inputs eq 'ARRAY') { }
0TFelsif (ref $inputs eq 'HASH') { }
199450TFif ($input_str eq "undef" and not $config{'test_undef'})
199750TFif ($new) { }
19980TFif ($status eq 'DIES') { }
0TFelsif ($status eq 'WARNS') { }
20090TFif (($output{'type'} // '') eq 'boolean') { }
20100TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
202250TFif ($status eq 'DIES') { }
50TFelsif ($status eq 'WARNS') { }
20230TFif ($module) { }
20310TFif ($module) { }
204050TFref $inputs eq 'ARRAY' ? :
204350TFif (($output{'type'} // '') eq 'boolean') { }
20440TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
2061100TFif (defined $seed)
2067100TFdefined $position_code ? :
210350TFunless $tt->process($template, $vars, \$test)
2105100TFif ($test_file) { }
210650TFunless &App::Test::Generator::open(my $fh, ">:encoding(UTF-8)", $test_file)
2109100TFif ($module) { }
2135100TFunless defined $name
2204100TFunless defined $schema_file
2206100TFunless length $schema_file
2210100TFunless -r $schema_file
221550TFif (my $schema = "Config::Abstraction"->new("config_dirs", [".", ""], "config_file", $schema_file, "no_fixate", 1))
222050TFif ($schema = $schema->all)
2223100TFif (exists $schema->{$LEGACY_PERL_KEY_1} or exists $schema->{$LEGACY_PERL_KEY_2})
2266100TFunless exists $schema->{$section}
2270100TFif ref $schema->{$section} eq "HASH"
2275100TFif defined $schema->{$section} and $schema->{$section} eq "undef"
2317100TFunless (defined $schema->{'module'} or defined $schema->{'function'})
2323100TFunless (defined $schema->{'input'} or defined $schema->{'output'})
2328100TFif ($schema->{'input'} and ref $schema->{'input'} ne "HASH")
2329100TFif ($schema->{'input'} eq 'undef') { }
2337100TFif ($schema->{'input'})
2344100TFif (exists $schema->{'transforms'} and ref $schema->{'transforms'} eq "HASH")
2349100TFif (ref $schema->{'config'} eq "HASH")
2353100TFunless grep {$_ eq $k;} ('test_nuls', 'test_undef', 'test_empty', 'test_non_ascii', 'dedup', 'properties', 'close_stdin', 'test_security')
2376100TFunless length $param
2382100TFif (ref $spec) { }
2384100TFunless defined $spec->{'type'}
2386100TFunless _valid_type($spec->{'type'})
238850TFunless _valid_type($spec)
2420100TFunless ref $spec eq "HASH" and defined $spec->{'position'}
2426100TFunless $pos =~ /^\d+$/u
2431100TFif exists $positions{$pos}
2437100TFif ($has_positions)
2440100TFunless (ref $spec eq "HASH" and defined $spec->{'position'})
2450100TFif ($sorted[$i] != $i)
2479100TFunless ref $spec eq "HASH"
2483100TFif (defined $spec->{'semantic'})
2485100TFunless (exists $semantic_generators->{$semantic})
2494100TFif ($spec->{'enum'} and $spec->{'memberof'})
2500100TFif (exists $spec->{$type})
2502100TFunless ref $spec->{$type} eq "ARRAY"
2532100TFunless exists $transform->{'properties'}
2535100TFunless ref $transform->{'properties'} eq "ARRAY"
2538100TFif (not ref $prop) { }
100TFelsif (ref $prop eq 'HASH') { }
2540100TFunless (exists $builtin_props->{$prop})
2547100TFunless ($prop->{'name'} and $prop->{'code'})
2591100TFif $field eq $CONFIG_PROPERTIES_KEY
2593100TFif (exists $config->{$field} and defined $config->{$field}) { }
259650TFif (defined(my $b = $Readonly::Values::Boolean::booleans{$config->{$field}}))
2609100TFunless ref $config->{$CONFIG_PROPERTIES_KEY} eq "HASH"
2643100TFunless defined $type
2706100TFunless $module
2711100TFif ($schema_file and not $mod_info)
272650TFif ($verbose)
273550TFif ($ENV{$ENV_VALIDATE_LOAD})
27380TFunless ($loaded)
27470TFif ($verbose)
2808100TFunless defined $v
2882100TFunless $href and ref $href eq "HASH"
2892100TFunless (defined $def and ref $def eq "HASH")
2893100TFif (defined $def and not ref $def and _valid_type($def)) { }
2906100TFunless defined $def->{$subk}
291050TFif (ref $def->{$subk})
29110TFunless (ref $def->{$subk} eq "ARRAY" or ref $def->{$subk} eq "Regexp")
2924100TFif ($subk eq $KEY_MATCHES or $subk eq $KEY_NOMATCH) { }
292750TFref $def->{$subk} eq 'Regexp' ? :
292850TFif ($@ or not defined $re)
2999100TFunless $href and ref $href eq "HASH"
3063100TFunless $href and ref $href eq "HASH"
3071100TFunless ref $aref eq "ARRAY"
3110100TFunless defined $input_spec and ref $input_spec eq "HASH"
3115100TFunless ref $input_spec->{$field} eq "HASH"
3118100TFif defined $input_spec->{$field}{'position'}
3159100TFunless defined $s
3167100TFunless $s =~ /\Q$l\E|\Q$r\E/u
3175100TFif index($s, $d) == $INDEX_NOT_FOUND
3214100TFunless defined $s
3269100TFunless defined $v
3273100TFif $v eq "true"
3274100TFif $v eq "false"
3276100TFif (ref $v)
3278100TFif (ref $v eq "ARRAY")
3284100TFif (ref $v eq "Regexp")
3289100TFif $mods
3300100TF&looks_like_number($v) ? :
3367100TFif (not defined $input_spec or not ref $input_spec and $input_spec eq "undef")
3376100TFunless ref $input_spec eq "HASH"
339250TFif (exists $transform->{'properties'} and ref $transform->{'properties'} eq "ARRAY")
340950TFunless @all_props
342150TFunless ref $spec eq "HASH"
342450TFif (defined $gen and length $gen)
3439100TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
345450TFif (_has_positions($input_spec)) { }
3964100TFunless defined $spec and ref $spec eq "HASH"
3974100TFif ($type eq "string" and defined $spec->{'semantic'})
397850TFif (exists $generators->{$semantic_type}) { }
3998100TFif ($type eq "integer")
4002100TFif (not defined $min || defined $max) { }
50TFelsif (not defined $min) { }
50TFelsif (not defined $max) { }
4021100TFif ($type eq "number" or $type eq "float")
4025100TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
100TFelsif (not defined $max) { }
403150TFif ($max == $ZERO_BOUNDARY) { }
0TFelsif ($max > $ZERO_BOUNDARY) { }
404450TFif ($min == $ZERO_BOUNDARY) { }
0TFelsif ($min > $ZERO_BOUNDARY) { }
405850TFif ($range <= $ZERO_BOUNDARY)
4071100TFif ($type eq "string")
4077100TFif (defined $spec->{'matches'})
408050TFif (defined $spec->{'max'}) { }
50TFelsif (defined $spec->{'min'}) { }
4095100TFif ($type eq "boolean")
4102100TFif ($type eq "arrayref")
411350TFif ($type eq "hashref")
4253100TFunless defined $spec and ref $spec eq "HASH"
4257100TFif defined $spec->{'type'}
4262100TFunless ref $spec->{$field} eq "HASH"
426450TFif defined $spec->{$field}{'type'}
4308100TFunless defined $properties and ref $properties eq "ARRAY"
4309100TFunless @{$properties;}
4321100TFif ($prop->{'should_die'}) { }
4385100TFunless defined $input_spec
4386100TFif not ref $input_spec and $input_spec eq "undef"
4395100TFif (_is_numeric_transform($input_spec, $output_spec))
4396100TFif (defined $output_spec->{'min'})
4404100TFif (defined $output_spec->{'max'})
4414100TFif ($transform_name =~ /$TRANSFORM_POSITIVE_PATTERN/iu)
4425100TFif (defined $output_spec->{'value'})
443050TFref $expected ? :
4441100TFif (_is_string_transform($input_spec, $output_spec))
4442100TFif (defined $output_spec->{'min'})
444950TFif (defined $output_spec->{'max'})
445650TFif (defined $output_spec->{'matches'})
4468100TFif (_same_type($input_spec, $output_spec))
4473100TFif ($type eq "number" or $type eq "integer" or $type eq "float")
4487100TFunless (($output_spec->{'type'} // "") eq "undef")
4553100TFif (not ref $prop_def) { }
100TFelsif (ref $prop_def eq 'HASH') { }
4557100TFunless (exists $builtin_properties->{$prop_name})
456750TFif (_has_positions($input_spec)) { }
457850TFif ($module and defined $new) { }
50TFelsif ($module and $module ne $MODULE_BUILTIN) { }
4602100TFunless ($prop_code)
460950TFunless ($prop_code =~ /\$/u or $prop_code =~ /\w+/u)