Branch Coverage

blib/lib/RDF/aREF/Encoder.pm
Criterion Covered Total %
branch 71 86 82.5


line true false branch
16 3 9 if (not defined $options{'ns'}) { }
3 6 elsif (not $options{'ns'}) { }
6 0 elsif (not &blessed($options{'ns'}) && $options{'ns'}->isa('RDF::NS')) { }
31 1 11 if ($options{'NFC'})
33 0 1 if $@
41 0 35 unless $self->{'sn'}
43 0 35 if @qname == 1
44 25 10 if @qname and $qname[1] =~ /^[A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}][A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}0-9\-\.\N{U+00B7}\N{U+0300}-\N{U+036F}\N{U+203F}-\N{U+2040}]*$/
51 12 5 if (my $qname = $self->qname($uri)) { }
62 1 19 if (not &reftype($subject)) { }
2 17 elsif (&reftype($subject) eq 'HASH') { }
17 0 elsif (&reftype($subject) eq 'ARRAY') { }
66 2 0 if ($subject->{'type'} eq 'uri' or $subject->{'type'} eq 'bnode')
71 17 0 if (@$subject == 2)
72 16 1 if ($subject->[0] eq 'URI') { }
1 0 elsif ($subject->[0] eq 'BLANK') { }
86 2 20 if (not &reftype($predicate)) { }
2 18 elsif (&reftype($predicate) eq 'HASH' and $predicate->{'type'} eq 'uri') { }
18 0 elsif (&reftype($predicate) eq 'ARRAY') { }
93 17 1 @$predicate == 2 && $predicate->[0] eq 'URI' ? :
99 3 19 if (not defined $predicate) { }
6 13 elsif ($predicate eq 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type') { }
9 4 elsif (my $qname = $self->qname($predicate)) { }
115 1 27 if (not &reftype($object)) { }
10 17 elsif (&reftype($object) eq 'HASH') { }
17 0 elsif (&reftype($object) eq 'ARRAY') { }
119 5 5 if ($object->{'type'} eq 'literal') { }
1 4 elsif ($object->{'type'} eq 'bnode') { }
128 8 9 if (@$object != 2) { }
8 1 elsif ($object->[0] eq 'URI') { }
1 0 elsif ($object->[0] eq 'BLANK') { }
141 2 14 if ($self->{'NFC'})
144 6 10 if ($language) { }
3 7 elsif ($datatype and $datatype ne 'http://www.w3.org/2001/XMLSchema#string') { }
154 4 1 $_[1] =~ /^([a-zA-Z0-9]+)$/ ? :
166 8 7 if (not keys %$aref || $self->{'subject_map'}) { }
6 1 elsif ($aref->{'_id'}) { }
171 4 2 if ($aref->{'_id'} eq $subject and not $self->{'subject_map'}) { }
180 1 1 if ($s eq $subject) { }
188 0 1 if ($aref->{$subject}) { }
201 0 5 if (ref $map->{$predicate}) { }
0 5 elsif (defined $map->{$predicate}) { }
221 0 4 $s =~ /^_:/ ? :