Branch Coverage

blib/lib/Treex/PML/Schema/Derive.pm
Criterion Covered Total %
branch 39 62 62.9


line true false branch
20 0 18 unless (exists $derive->{'type'})
23 16 2 if (not exists $derive->{'name'})
34 0 17 if $schema->get_decl_type == 22 and $opts->{'no_template_derive'} or $schema->get_decl_type == 14 and $opts->{'no_derive'}
39 0 18 unless (defined $source and length $source)
42 18 0 if (defined $name and length $name) { }
43 0 18 if (exists $schema->{'type'}{$name} and $source ne $name)
54 7 11 if ($derive->{'structure'}) { }
2 9 elsif ($derive->{'sequence'}) { }
7 2 elsif ($derive->{'container'}) { }
2 0 elsif ($derive->{'choice'}) { }
55 7 0 if ($type->{'structure'}) { }
59 3 11 if (exists $derive_structure->{$attr})
62 0 3 unless grep {$_ eq $attr;} @{$$target_structure{'-attributes'};}
70 0 7 if (ref $derive_structure->{'delete'})
80 2 0 if ($type->{'sequence'}) { }
83 0 2 if (exists $derive_sequence->{'role'})
86 0 0 unless grep {$_ eq 'role';} @{$$target_sequence{'-attributes'};}
88 2 0 if (exists $derive_sequence->{'content_pattern'})
91 2 0 unless grep {$_ eq 'content_pattern';} @{$$target_sequence{'-attributes'};}
98 0 2 if (ref $derive_sequence->{'delete'})
109 7 0 if ($type->{'container'}) { }
113 12 2 unless exists $derive_container->{$attr}
114 1 1 if ($attr eq 'type' and not exists $target_container->{'type'})
116 1 5 if (exists $target_container->{$d})
126 1 1 unless grep {$_ eq $attr;} @{$$target_container{'-attributes'};}
133 1 6 if (ref $derive_container->{'delete'})
143 2 0 if ($type->{'choice'}) { }
145 2 0 if (UNIVERSAL::isa($choice, 'HASH')) { }
146 2 0 if ref $choice->{'values'}
147 2 0 if ref $choice->{'delete'}
158 0 0 unless ($name ne $source)