Branch Coverage

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

line%coveragebranch
123250TFif ($_[0] and $_[0] eq __PACKAGE__)
124350TFif (ref $args or defined $_[2]) { }
12540TFif ($params->{'input_file'}) { }
0TFelsif ($params->{'schema'}) { }
1265100TFif (defined $schema_file) { }
126750TFunless (defined $schema)
1280100TFif exists $schema->{'cases'}
128150TFif exists $schema->{'edge_cases'}
128250TFif exists $schema->{'type_edge_cases'}
128450TFif exists $schema->{'module'} and length $schema->{'module'}
128550TFif exists $schema->{'function'}
1286100TFif (exists $schema->{'new'})
1287100TFdefined $schema->{'new'} ? :
1289100TFif exists $schema->{'yaml_cases'}
129050TFif exists $schema->{'seed'}
1291100TFif exists $schema->{'iterations'}
1293100TFif exists $schema->{'edge_case_array'}
1296100TFif exists $schema->{'config'}
130150TFif (not $module) { }
100TFelsif ($module eq 'builtin') { }
13020TFif ($schema_file)
131050TFif ($module and length $module and $module ne "builtin")
131750TFif defined $seed and $seed eq ""
1321100TFif (defined $yaml_cases)
1322100TFunless -f $yaml_cases
132550TFif ($yaml_data and ref $yaml_data eq "HASH")
1331100TFunless ($outputs and ref $outputs eq "ARRAY")
1337100TFif $valid_input
134550TFif (exists $cases{$k} and ref $cases{$k} eq "ARRAY" and ref $yaml_corpus_data{$k} eq "ARRAY")
135050TFif (my $hints = delete $schema->{'_yamltest_hints'})
13510TFif (my $boundaries = $hints->{'boundary_values'})
13540TFif (my $invalid = $hints->{'invalid'})
136050TFif ($schema->{'type'} and $schema->{'type'} =~ /^(integer|number|float)$/u)
13620TFunless defined $_
13630TFif &Scalar::Util::looks_like_number($_)
137050TF&Scalar::Util::looks_like_number($_) ? :
50TFdefined $_ ? :
137650TFunless defined $a
137750TFunless defined $b
138250TFif $na and $nb
138350TFif $na
138450TFif $nb
1399100TFif (scalar @edge_case_array)
1408100TFif (ref $config{$key} eq "HASH")
1411100TFif (not defined $config{$key} && $config{$key}) { }
1422100TFif (scalar keys %input == 1 and exists $input{'type'} and not ref $input{'type'}) { }
143150TFif (defined(my $re = $output{'matches'}))
14320TFif (ref $re ne "Regexp")
1438100TF$new && ref $new eq 'HASH' ? :
1441100TFif (keys %transforms)
1445100TFif ($transforms_code)
146250TFif (keys %transforms and $config{'properties'}{'enable'} // 0)
1480100TF$module ? :
1484100TFif (defined $new) { }
100TFelsif (defined $module and length $module) { }
1486100TFif ($new_code eq '') { }
149150TFif ($has_positions) { }
149550TFif ($output{'_returns_self'})
150050TFif ($function eq 'new') { }
15010TFif ($has_positions) { }
150750TFif ($has_positions) { }
1514100TFif ($has_positions) { }
1523100TFif (%all_cases)
152950TFunless $inputs
153350TFif ($expected_str eq q['_STATUS:DIES']) { }
50TFelsif ($expected_str eq q['_STATUS:WARNS']) { }
153950TFif (ref $inputs eq "HASH")
154350TFif (ref $inputs eq 'ARRAY') { }
0TFelsif (ref $inputs eq 'HASH') { }
155350TFif ($input_str eq "undef" and not $config{'test_undef'})
155650TFif ($new) { }
15570TFif ($status eq 'DIES') { }
0TFelsif ($status eq 'WARNS') { }
15680TFif ($output{'type'} eq 'boolean') { }
15690TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
158150TFif ($status eq 'DIES') { }
50TFelsif ($status eq 'WARNS') { }
15820TFif ($module) { }
15900TFif ($module) { }
159950TFref $inputs eq 'ARRAY' ? :
160250TFif ($output{'type'} eq 'boolean') { }
16030TFif ($expected_str eq '1') { }
0TFelsif ($expected_str eq '0') { }
162050TFif (defined $seed)
1626100TFdefined $position_code ? :
166150TFunless $tt->process($template, $vars, \$test)
1663100TFif ($test_file) { }
166450TFunless &App::Test::Generator::open(my $fh, ">:encoding(UTF-8)", $test_file)
1667100TFif ($module) { }
1682100TFunless (-r $schema_file)
169250TFif (my $schema = "Config::Abstraction"->new("config_dirs", [".", ""], "config_file", $schema_file))
169350TFif ($schema = $schema->all)
169450TFif (defined $schema->{'$module'} or defined $schema->{'our $module'} or not defined $schema->{'module'})
1707100TFif (exists $schema->{$section})
1708100TFif (ref $schema->{$section} eq 'HASH') { }
100TFelsif (defined $schema->{$section} and $schema->{$section} ne 'undef') { }
171250TFif (ref $schema->{$section} and length $schema->{$section}) { }
17260TFunless (defined $config->{'module'} or defined $config->{'function'})
1731100TFunless (defined $config->{'input'} or defined $config->{'output'})
173550TFif ($config->{'input'} and ref $config->{'input'} ne "HASH")
17360TFif ($config->{'input'} eq 'undef') { }
1743100TFif ($config->{'input'})
174650TFunless (length $param)
1750100TFif (ref $spec) { }
175150TFunless defined $spec->{'type'}
1752100TFunless _valid_type($spec->{'type'})
175450TFunless _valid_type($spec)
1764100TFif (ref $spec eq "HASH" and defined $spec->{'position'})
176950TFunless $pos =~ /^\d+$/u
177250TFif exists $positions{$pos}
1779100TFif ($has_positions)
178250TFunless (ref $spec eq "HASH" and defined $spec->{'position'})
179050TFif ($sorted[$i] != $i)
1801100TFif (ref $spec eq "HASH")
180250TFif (defined $spec->{'semantic'})
18040TFunless (exists $semantic_generators->{$semantic})
18090TFif ($spec->{'enum'} and $spec->{'memberof'})
181350TFif (exists $spec->{$type})
18140TFunless ref $spec->{$type} eq "ARRAY"
1822100TFif (exists $config->{'transforms'} and ref $config->{'transforms'} eq "HASH")
182850TFif (exists $transform->{'properties'})
18290TFunless (ref $transform->{'properties'} eq "ARRAY")
18340TFif (not ref $prop) { }
0TFelsif (ref $prop eq 'HASH') { }
18360TFunless (exists $builtin_props->{$prop})
18430TFunless ($prop->{'name'} and $prop->{'code'})
1855100TFif (ref $config->{'config'} eq "HASH")
185850TFunless (grep {$_ eq $k;} ('test_nuls', 'test_undef', 'test_empty', 'test_non_ascii', 'dedup', 'properties', 'close_stdin'))
1872100TFif $field eq "properties"
1873100TFif (exists $config->{$field}) { }
1874100TFif ($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') { }
1884100TFunless ref $config->{'properties'} eq "HASH"
189150TFunless defined $type
190250TFunless $module
1907100TFif ($schema_file and not $mod_info)
191950TFif ($ENV{'TEST_VERBOSE'} or $ENV{'GENERATOR_VERBOSE'})
192550TFif ($ENV{'GENERATOR_VALIDATE_LOAD'})
19280TFunless ($loaded)
19350TFif ($ENV{'TEST_VERBOSE'} or $ENV{'GENERATOR_VERBOSE'})
194650TFunless defined $s
196150TFunless defined $v
196250TFif $v eq "true"
1963100TFif (ref $v)
196450TFif (ref $v eq "ARRAY")
196850TFif (ref $v eq "Regexp")
19720TFif $mods
1980100TF&looks_like_number($v) ? :
199650TFunless $href and ref $href eq "HASH"
2000100TFunless ref $def eq "HASH"
200350TFunless defined $def->{$subk}
200450TFif (ref $def->{$subk})
20050TFunless (ref $def->{$subk} eq "ARRAY" or ref $def->{$subk} eq "Regexp")
200950TFif ($subk eq 'matches' or $subk eq 'nomatch') { }
202350TFunless $href and ref $href eq "HASH"
203050TFunless $href and ref $href eq "HASH"
20340TFunless ref $aref eq "ARRAY"
204650TFunless defined $s
205050TFunless $s =~ /\Q$l\E|\Q$r\E/u
20530TFunless index($s, $d) != -1
207750TFif (not ref $input_spec and $input_spec eq "undef")
209050TFif (exists $transform->{'properties'} and ref $transform->{'properties'} eq "ARRAY")
210550TFunless @all_props
210750TFunless ref $input_spec eq "HASH"
211550TFunless ref $spec eq "HASH"
211750TFif (defined(my $gen = _schema_to_lectrotest_generator($field, $spec)))
211850TFif (length $gen)
212950TFif ($module and defined $new) { }
50TFelsif ($module and $module ne 'builtin') { }
214150TFif (_has_positions($input_spec)) { }
21840TFdefined $schema->{'new'} ? :
21910TFif (not ref $prop_def) { }
0TFelsif (ref $prop_def eq 'HASH') { }
21950TFif (exists $builtin_properties->{$prop_name}) { }
22030TFif (_has_positions($input_spec)) { }
22150TFif ($module and defined $new) { }
0TFelsif ($module and $module ne 'builtin') { }
22380TFunless ($prop_code)
22440TFunless ($prop_code =~ /\$/u or $prop_code =~ /\w+/u)
227650TFif not ref $input_spec and $input_spec eq "undef"
227950TFif (_is_numeric_transform($input_spec, $output_spec))
228050TFif (defined $output_spec->{'min'})
228950TFif (defined $output_spec->{'max'})
2300100TFif ($transform_name =~ /positive/iu)
231050TFif (defined $output_spec->{'value'})
23120TFref $expected ? :
232250TFif (_is_string_transform($input_spec, $output_spec))
23230TFif (defined $output_spec->{'min'})
23300TFif (defined $output_spec->{'max'})
23370TFif (defined $output_spec->{'matches'})
234750TFif (_same_type($input_spec, $output_spec))
23500TFif ($type eq "number" or $type eq "integer" or $type eq "float")
235950TFunless (($output_spec->{'type'} // "") eq "undef")
275450TFif ($type eq "string" and defined $spec->{'semantic'})
27580TFif (exists $generators->{$semantic_type}) { }
2771100TFif ($type eq 'integer') { }
100TFelsif ($type eq 'number' or $type eq 'float') { }
100TFelsif ($type eq 'string') { }
50TFelsif ($type eq 'boolean') { }
50TFelsif ($type eq 'arrayref') { }
50TFelsif ($type eq 'hashref') { }
277550TFif (not defined $min || defined $max) { }
50TFelsif (not defined $min) { }
50TFelsif (not defined $max) { }
279050TFif (not defined $min || defined $max) { }
100TFelsif (not defined $min) { }
50TFelsif (not defined $max) { }
279550TFif ($max == 0) { }
0TFelsif ($max > 0) { }
280750TFif ($min == 0) { }
0TFelsif ($min > 0) { }
28200TFif ($range <= 0)
283250TFif (defined $spec->{'matches'})
28360TFif (defined $spec->{'max'}) { }
0TFelsif (defined $spec->{'min'}) { }
2897100TFif defined $spec->{'type'}
290150TFunless ref $spec->{$field} eq "HASH"
290250TFif defined $spec->{$field}{'type'}
2912100TFunless ref $input_spec->{$field} eq "HASH"
2913100TFif defined $input_spec->{$field}{'position'}
293750TFif ($prop->{'should_die'}) { }