Branch Coverage

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

line%coveragebranch
118450TFif ($_[0] and $_[0] eq __PACKAGE__)
1197100TFif (defined $schema_file) { }
119850TFif (my $schema = _load_schema($schema_file)) { }
1204100TFif exists $schema->{'cases'}
120550TFif exists $schema->{'edge_cases'}
120650TFif exists $schema->{'type_edge_cases'}
120850TFif exists $schema->{'module'}
120950TFif exists $schema->{'function'}
1210100TFif (exists $schema->{'new'})
1211100TFdefined $schema->{'new'} ? :
1213100TFif exists $schema->{'yaml_cases'}
121450TFif exists $schema->{'seed'}
1215100TFif exists $schema->{'iterations'}
1217100TFif exists $schema->{'edge_case_array'}
1220100TFif exists $schema->{'config'}
1230100TFif (exists $config{$field}) { }
1231100TFif ($config{$field} eq 'false' or $config{$field} eq 'off' or $config{$field} eq 'no') { }
50TFelsif ($config{$field} eq 'true' or $config{$field} eq 'on' or $config{$field} eq 'yes') { }
1242100TFif ($module eq 'builtin') { }
50TFelsif (not $module) { }
1250100TFif ($module and $module ne "builtin")
125750TFif defined $seed and $seed eq ""
1261100TFif (defined $yaml_cases)
1262100TFunless -f $yaml_cases
126550TFif ($yaml_data and ref $yaml_data eq "HASH")
1271100TFunless ($outputs and ref $outputs eq "ARRAY")
1277100TFif $valid_input
128550TFif (exists $cases{$k} and ref $cases{$k} eq "ARRAY" and ref $yaml_corpus_data{$k} eq "ARRAY")
1295100TFif (scalar @edge_case_array)
1304100TFif (ref $config{$key} eq "HASH")
1307100TFif (not defined $config{$key} && $config{$key}) { }
1318100TFif (scalar keys %input == 1 and exists $input{'type'} and not ref $input{'type'}) { }
132750TFif (defined(my $re = $output{'matches'}))
13280TFif (ref $re ne "Regexp")
1334100TF$new && ref $new eq 'HASH' ? :
1337100TFif (keys %transforms)
1339100TFif ($transforms_code)
135550TFif (keys %transforms and $config{'properties'}{'enable'} // 0)
1373100TF$module ? :
1376100TFif (defined $new) { }
100TFelsif (defined $module) { }
1378100TFif ($new_code eq '') { }
1395100TFif (%all_cases)
140150TFunless $inputs
140550TFif ($expected_str eq q['_STATUS:DIES']) { }
50TFelsif ($expected_str eq q['_STATUS:WARNS']) { }
141150TFif (ref $inputs eq "HASH")
141550TFif (ref $inputs eq 'ARRAY') { }
0TFelsif (ref $inputs eq 'HASH') { }
142550TFif ($input_str eq "undef" and not $config{'test_undefs'})
142850TFif ($new) { }
14290TFif ($status eq 'DIES') { }
0TFelsif ($status eq 'WARNS') { }
144350TFif ($status eq 'DIES') { }
50TFelsif ($status eq 'WARNS') { }
145150TFref $inputs eq 'ARRAY' ? :
146250TFif (defined $seed)
149650TFunless $tt->process($template, $vars, \$test)
1498100TFif ($test_file) { }
149950TFunless &App::Test::Generator::open(my $fh, ">:encoding(UTF-8)", $test_file)
1502100TFif ($module) { }
151750TFunless (-r $schema_file)
152750TFif (my $config = "Config::Abstraction"->new("config_dirs", [".", ""], "config_file", $schema_file))
152950TFif (defined $config->{'$module'} or defined $config->{'our $module'} or not defined $config->{'module'})
1540100TFif (exists $schema->{$section})
1541100TFif (ref $schema->{$section} eq 'HASH') { }
100TFelsif (defined $schema->{$section} and $schema->{$section} ne 'undef') { }
154550TFif (ref $schema->{$section} and length $schema->{$section}) { }
15590TFunless (defined $config->{'module'} or defined $config->{'function'})
1564100TFunless (defined $config->{'input'} or defined $config->{'output'})
156850TFif ($config->{'input'} and ref $config->{'input'} ne "HASH")
15690TFif ($config->{'input'} eq 'undef') { }
1579100TFif (ref $spec) { }
1580100TFunless _valid_type($spec->{'type'})
158250TFunless _valid_type($spec)
1592100TFif (ref $spec eq "HASH" and defined $spec->{'position'})
159750TFunless $pos =~ /^\d+$/u
160050TFif exists $positions{$pos}
1607100TFif ($has_positions)
161050TFunless (ref $spec eq "HASH" and defined $spec->{'position'})
161850TFif ($sorted[$i] != $i)
162950TFif (ref $spec eq "HASH" and defined $spec->{'semantic'})
16310TFunless (exists $semantic_generators->{$semantic})
1639100TFif (exists $config->{'transforms'} and ref $config->{'transforms'} eq "HASH")
164550TFif (exists $transform->{'properties'})
16460TFunless (ref $transform->{'properties'} eq "ARRAY")
16510TFif (not ref $prop) { }
0TFelsif (ref $prop eq 'HASH') { }
16530TFunless (exists $builtin_props->{$prop})
16600TFunless ($prop->{'name'} and $prop->{'code'})
169050TFunless $module
1695100TFunless ($mod_info)
170750TFif ($ENV{'TEST_VERBOSE'} or $ENV{'GENERATOR_VERBOSE'})
171350TFif ($ENV{'GENERATOR_VALIDATE_LOAD'})
17160TFunless ($loaded)
17220TFif ($ENV{'TEST_VERBOSE'} or $ENV{'GENERATOR_VERBOSE'})
173850TFunless defined $v
1739100TFif (ref $v)
174050TFif (ref $v eq "ARRAY")
174450TFif (ref $v eq "Regexp")
17480TFunless $s =~ /[{}]/u
17510TFunless $s =~ m[/]u
1764100TF$v =~ /^-?\d+(\.\d+)?$/u ? :
176950TFunless $href and ref $href eq "HASH"
1773100TFunless ref $def eq "HASH"
177650TFunless defined $def->{$subk}
177750TFif (ref $def->{$subk})
17780TFunless (ref $def->{$subk} eq "ARRAY" or ref $def->{$subk} eq "Regexp")
178250TFif ($subk eq 'matches' or $subk eq 'nomatch') { }
179550TFunless $href and ref $href eq "HASH"
180250TFunless $href and ref $href eq "HASH"
18060TFunless ref $aref eq "ARRAY"
181850TFunless $s =~ /\Q$l\E|\Q$r\E/u
18210TFunless index($s, $d) != -1
184650TFif (not ref $input_spec and $input_spec eq "undef")
185950TFif (exists $transform->{'properties'} and ref $transform->{'properties'} eq "ARRAY")
187450TFunless @all_props
188250TFunless ref $spec eq "HASH"
189350TFif ($module) { }
190250TFif (_has_positions($input_spec)) { }
19430TFdefined $schema->{'new'} ? :
19500TFif (not ref $prop_def) { }
0TFelsif (ref $prop_def eq 'HASH') { }
19540TFif (exists $builtin_properties->{$prop_name}) { }
19630TFif ($module and defined $new) { }
0TFelsif ($module and $module ne 'builtin') { }
19740TFif (_has_positions($input_spec)) { }
19980TFunless ($prop_code)
20040TFunless ($prop_code =~ /\$/u or $prop_code =~ /\w+/u)
203650TFif not ref $input_spec and $input_spec eq "undef"
203950TFif (_is_numeric_transform($input_spec, $output_spec))
204050TFif (defined $output_spec->{'min'})
204850TFif (defined $output_spec->{'max'})
2058100TFif ($transform_name =~ /positive/iu)
206750TFif (defined $output_spec->{'value'})
207650TFif (_is_string_transform($input_spec, $output_spec))
20770TFif (defined $output_spec->{'min'})
20840TFif (defined $output_spec->{'max'})
20910TFif (defined $output_spec->{'matches'})
210150TFif (_same_type($input_spec, $output_spec))
21040TFif ($type eq "number" or $type eq "integer" or $type eq "float")
211350TFunless (($output_spec->{'type'} // "") eq "undef")
250050TFif ($type eq "string" and defined $spec->{'semantic'})
25040TFif (exists $generators->{$semantic_type}) { }
251750TFif ($type eq 'integer') { }
50TFelsif ($type eq 'number' or $type eq 'float') { }
0TFelsif ($type eq 'string') { }
0TFelsif ($type eq 'boolean') { }
0TFelsif ($type eq 'arrayref') { }
0TFelsif ($type eq 'hashref') { }
25210TFif (not defined $min || defined $max) { }
0TFelsif (not defined $min) { }
0TFelsif (not defined $max) { }
253650TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
50TFelsif (not defined $max) { }
254150TFif ($max == 0) { }
0TFelsif ($max > 0) { }
255350TFif ($min == 0) { }
0TFelsif ($min > 0) { }
25660TFif ($range <= 0)
25780TFif (defined $spec->{'matches'})
25820TFif (defined $spec->{'max'}) { }
0TFelsif (defined $spec->{'min'}) { }
2643100TFif defined $spec->{'type'}
264750TFunless ref $spec->{$field} eq "HASH"
264850TFif defined $spec->{$field}{'type'}
265850TFunless ref $spec->{$field} eq "HASH"
265950TFif defined $spec->{$field}{'position'}
268350TFif ($prop->{'should_die'}) { }