Branch Coverage

blib/lib/Syntax/Highlight/RDF.pm
Criterion Covered Total %
branch 113 216 52.3


line true false branch
124 4 0 if defined $_[0]->prefix
125 4 0 if defined $_[0]->absolute_uri
130 9 0 if defined $_[0]->prefix
131 5 4 if defined $_[0]->suffix
132 9 0 if defined $_[0]->absolute_uri
137 7 0 if defined $_[0]->absolute_uri
142 2 0 if defined $_[0]->absolute_uri
393 558 305 unless ref $regexp
395 78 785 if (my(@m) = ${$self->_remaining;} =~ /$regexp/)
407 0 78 unless defined $spelling
415 0 0 ${$self->_remaining;} =~ /^(_:[$nameStartChar][$nameChar]*)/ ? :
425 0 0 ${$self->_remaining;} =~ /^([\?\$][$nameStartChar][$nameChar]*)/ ? :
432 35 0 if ${$self->_remaining;} =~ /^(\s*)/ms
439 7 0 if ${$self->_remaining;} =~ /^(<(?:\\\\|\\.|[^<>\\]){0,1024}>)/
447 9 0 if ${$self->_remaining;} =~ /^(([$nameStartChar2][$nameChar]*)?:([$nameStartChar2][$nameChar]*)?)/
457 0 2 if $spelling =~ /^d/
458 0 2 if $spelling =~ /^r/
459 0 2 if $spelling =~ /^m/
460 0 2 if $spelling =~ /^f/
461 0 2 if $spelling =~ /^p/
464 0 2 if $spelling =~ /::/
465 0 2 if $spelling =~ m[/]
466 1 1 if length $v
477 2 0 if ${$self->_remaining;} =~ /^($quote_char(?:\\\\|\\.|[^$quote_char])*?$quote_char)/
486 0 0 if ${$self->_remaining;} =~ /^(${quote_char}{3}.*?${quote_char}{3})/ms
494 0 0 if (blessed $thing and $thing->isa('RDF::Trine::Model') and $self->can('_serializer'))
500 0 0 if (blessed $thing and $thing->isa('RDF::Trine::Iterator') and $self->can('_serializer'))
506 0 2 unless (ref $thing eq 'SCALAR')
520 0 2 unless ref $self
554 35 43 if ($self->_peek(' ') or $self->_peek("\n") or $self->_peek("\r") or $self->_peek("\t")) { }
0 43 elsif ($IS_NOTATION_3 || $IS_SPARQL || $IS_TRIG and $self->_peek('{')) { }
0 43 elsif ($IS_NOTATION_3 || $IS_SPARQL || $IS_TRIG and $self->_peek('}')) { }
0 43 elsif ($ABOVE_NTRIPLES and $self->_peek('[')) { }
0 43 elsif ($ABOVE_NTRIPLES and $self->_peek(']')) { }
0 43 elsif ($ABOVE_NTRIPLES and $self->_peek('(')) { }
0 43 elsif ($ABOVE_NTRIPLES and $self->_peek(')')) { }
0 43 elsif ($self->_peek('^^')) { }
0 43 elsif ($IS_NOTATION_3 and $matches = $self->_peek(qr/^([\!\^])/)) { }
3 40 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^([\,\;])/)) { }
9 31 elsif ($self->_peek('.')) { }
6 25 elsif ($IS_NOTATION_3 || $IS_TURTLE || $IS_TRIG and $matches = $self->_peek(qr/^(\@(?:prefix|base))/)) { }
0 25 elsif ($IS_NOTATION_3 and $matches = $self->_peek(qr/^(\@(?:keywords|forSome|forAll))/)) { }
0 25 elsif ($matches = $self->_peek(qr/^(\@[a-z0-9-]+)/i)) { }
0 25 elsif ($matches = $self->_peek(qr/^(#.*?)(?:\r|\n|$)/is)) { }
0 25 elsif ($IS_PRETDSL and $matches = $self->_peek(qr/^(RT#[0-9]+)/i)) { }
1 24 elsif ($IS_PRETDSL and $matches = $self->_peek(qr/^(cpan:\w+)/i)) { }
2 22 elsif ($IS_PRETDSL and $matches = $self->_peek(qr/^([drfmp]?`.*?`)/i)) { }
0 22 elsif ($IS_PRETDSL and $matches = $self->_peek(qr/^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{4}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})?)/i)) { }
1 21 elsif ($IS_PRETDSL and $matches = $self->_peek(qr/^([0-9]{4}-[0-9]{2}-[0-9]{2})/i)) { }
2 19 elsif ($IS_PRETDSL and $matches = $self->_peek($pretdslKeyword)) { }
0 19 elsif ($self->_peek('_:')) { }
9 10 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^([$nameStartChar2][$nameChar]*)?:([$nameStartChar2][$nameChar]*)?/)) { }
0 10 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^([\-\+]?([0-9]+\.[0-9]*e[\-\+]?[0-9]+))/i)) { }
0 10 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^([\-\+]?(\.[0-9]+e[\-\+]?[0-9]+))/i)) { }
0 10 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^([\-\+]?([0-9]+e[\-\+]?[0-9]+))/i)) { }
0 10 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^([\-\+]?([0-9]+\.[0-9]*))/)) { }
0 10 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^([\-\+]?(\.[0-9]+))/)) { }
1 9 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^([\-\+]?([0-9]+))/)) { }
7 2 elsif ($self->_peek('<')) { }
0 2 elsif ($IS_NOTATION_3 || $IS_SPARQL and $self->_peek('?')) { }
0 2 elsif ($IS_SPARQL and $self->_peek('$')) { }
0 2 elsif ($IS_SPARQL and $self->_peek('*')) { }
0 2 elsif ($ABOVE_NTRIPLES and $self->_peek('"""') || $self->_peek(q['''])) { }
0 2 elsif ($ABOVE_NTRIPLES and $self->_peek(q['])) { }
2 0 elsif ($self->_peek('"')) { }
0 0 elsif ($IS_SPARQL and $matches = $self->_peek($sparqlKeyword)) { }
0 0 elsif ($IS_SPARQL and $matches = $self->_peek($sparqlFunction)) { }
0 0 elsif ($IS_SPARQL and $matches = $self->_peek($sparqlAggregate)) { }
0 0 elsif ($IS_SPARQL and $matches = $self->_peek($sparqlOrdering)) { }
0 0 elsif ($IS_SPARQL and $matches = $self->_peek($sparqlOperator)) { }
0 0 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^(true|false)\b/i)) { }
0 0 elsif ($ABOVE_NTRIPLES and $self->_peek(qr/^(a)\b/)) { }
0 0 elsif ($IS_NOTATION_3 and $matches = $self->_peek(qr/^(=|=>|<=)/)) { }
0 0 elsif ($IS_TRIG and $self->_peek('=')) { }
0 0 elsif ($IS_NOTATION_3 and $matches = $self->_peek(qr/^(is|of)\b/i)) { }
0 0 elsif ($ABOVE_NTRIPLES and $matches = $self->_peek(qr/^([$nameStartChar][$nameChar]*)/)) { }
0 0 elsif ($matches = $self->_peek(qr/^([^\s\r\n]+)[\s\r\n]/ms)) { }
0 0 elsif ($matches = $self->_peek(qr/^([^\s\r\n]+)$/ms)) { }
776 2 7 unless length $base
781 0 3 unless ('URI'->new($relative)->scheme or 'URI'->new($base)->scheme)
784 0 0 $base =~ m[^/] ? :
805 7 69 if ($t->isa(URIRef()) and not defined $t->absolute_uri) { }
2 130 elsif ($t->isa(Sparql_Keyword()) and lc $t->spelling eq 'base' or $t->isa(AtRule()) and lc $t->spelling eq '@base') { }
817 0 2 unless defined $$tokens[$i + $j]
819 2 0 if (defined $$tokens[$i + $j] and $$tokens[$i + $j]->can('uri'))
844 4 74 if ($t->isa(AtRule()) and lc $t->spelling eq '@prefix') { }
0 74 elsif ($t->isa(Sparql_Keyword()) and lc $t->spelling eq 'PREFIX') { }
14 60 elsif (defined $started and $t->isa(CURIE()) || $t->isa(URIRef())) { }
4 69 elsif (defined $started and @bits == 3 and $t->spelling eq '.' and $bits[0]->isa(AtRule())) { }
863 0 62 if (not $is_end and defined $started and @bits == 3 and $bits[0]->isa(Sparql_Keyword()))
868 4 74 if ($is_end)
931 1 1 $self->mode & 8 ? :
940 4 82 if ($t->isa(PrefixDefinition_End())) { }
5 77 elsif ($t->isa(CURIE()) and defined $t->prefix and exists $$map{$t->prefix}) { }
954 0 2 unless ref $self
988 0 0 if eval { do { require RDF::TrineX::Serializer::MockTurtleSoup } }
1073 0 4 unless $class eq 'Syntax::Highlight::RDF'
1077 1 3 if ($hint =~ /xml/i)
1082 1 2 if ($hint =~ /json/i)
1087 1 1 if $hint =~ /(ttl|turtle)/i
1088 0 1 if $hint =~ /(nt|n.?triples)/i
1089 0 1 if $hint =~ /(nq|n.?quads)/i
1090 0 1 if $hint =~ /(trig)/i
1091 0 1 if $hint =~ /(n3|notation.?3)/i
1092 1 0 if $hint =~ /(pret)/i
1093 0 0 if $hint =~ /(sparql.?update)/i
1094 0 0 if $hint =~ /(sparql)/i
1095 0 0 if $hint =~ m[(text/plain)]i