Branch Coverage

blib/lib/YAML/Perl/Scanner.pm
Criterion Covered Total %
branch 189 280 67.5


line true false branch
80 0 0 if (wantarray) { }
88 0 0 $self->check_token ? :
100 1040 0 if (@{$self->tokens;})
101 0 1040 unless (@choices)
105 314 962 if ($self->tokens->[0]->isa($choice))
118 194 0 if (@{$self->tokens;})
129 315 0 if (@{$self->tokens;})
140 253 1519 if ($self->done)
143 168 1351 unless (@{$self->tokens;})
148 55 1296 if (defined $next and $next == $self->tokens_taken)
165 29 194 if ($ch eq "\000")
169 2 192 if ($ch eq '%' and $self->check_directive)
173 28 164 if ($ch eq '-' and $self->check_document_start)
177 1 163 if ($ch eq '.' and $self->check_document_end)
181 6 157 if ($ch eq '[')
185 4 153 if ($ch eq '{')
189 6 147 if ($ch eq ']')
193 4 143 if ($ch eq '}')
197 6 137 if ($ch eq ',')
201 20 117 if ($ch eq '-' and $self->check_block_entry)
205 1 116 if ($ch eq '?' and $self->check_key)
209 27 89 if ($ch eq ':' and $self->check_value)
213 3 86 if ($ch eq '*')
217 3 83 if ($ch eq '&')
221 8 75 if ($ch eq '!')
225 3 72 if ($ch eq '|' and not $self->flow_level)
229 1 71 if ($ch eq '>' and not $self->flow_level)
233 4 67 if ($ch eq q['])
237 3 64 if ($ch eq '"')
241 64 0 if ($self->check_plain)
255 65 1 if (not defined $min_token_number or $key->token_number < $min_token_number)
268 24 117 if ($key->line != $self->reader->line or $self->reader->index - $key->index > 1024)
271 0 24 if ($key->required)
286 56 39 if ($self->allow_simple_key)
303 6 123 if (exists $self->possible_simple_keys->{$self->flow_level})
306 0 6 if ($key->required)
319 40 243 if ($self->flow_level)
335 21 21 if ($self->indent < $column)
464 20 0 unless ($self->flow_level)
465 0 20 unless ($self->allow_simple_key)
471 6 14 if ($self->add_indent($self->reader->column))
492 1 0 unless ($self->flow_level)
493 0 1 unless ($self->allow_simple_key)
499 1 0 if ($self->add_indent($self->reader->column))
521 26 1 if (exists $self->possible_simple_keys->{$self->flow_level}) { }
530 20 6 unless ($self->flow_level)
531 14 6 if ($self->add_indent($key->column))
546 1 0 unless ($self->flow_level)
550 0 1 unless ($self->allow_simple_key)
563 1 0 unless ($self->flow_level)
564 0 1 if ($self->add_indent($self->reader->column))
668 2 0 if ($self->reader->column == 0)
676 48 0 if ($self->reader->column == 0)
677 28 20 if ($self->reader->prefix(3) eq '---' and $self->reader->peek(3) =~ /^[\0\ \t\r\n\x85\x{2028}\x{2029}]$/)
688 1 0 if ($self->reader->column == 0)
689 1 0 if ($self->reader->prefix(3) eq '...' and $self->reader->peek(3) =~ /^[\0\ \t\r\n\x85\x{2028}\x{2029}]$/)
706 0 1 if ($self->flow_level) { }
718 6 21 if ($self->flow_level) { }
722 21 0 $self->reader->peek(1) =~ /^[\0\ \t\r\n]$/ ? :
738 0 223 if ($self->reader->index == 0 and $self->reader->peek eq 'FEFF')
745 0 269 if ($self->reader->peek eq '#')
750 46 223 if ($self->scan_line_break) { }
751 40 6 unless ($self->flow_level)
768 1 1 if ($name eq 'YAML') { }
1 0 elsif ($name eq 'TAG') { }
800 0 2 unless ($length)
807 0 2 unless ($ch =~ /^[\0 \r\n\x8520282029]$/)
821 0 1 if ($self->reader->peek ne '.')
827 0 1 unless ($self->reader->peek =~ /^[\0 \r\n\x8520282029]$/)
839 0 2 unless ($ch =~ /^[0-9]$/)
871 0 1 if ($ch ne ' ')
887 0 1 unless ($ch =~ /^[\0\ \r\n\x85\x{2028}\x{2029}]$/)
904 0 2 if ($self->reader->peek eq '#')
910 0 2 unless ($ch =~ /^[\0\r\n\x8520282029]$/)
923 3 3 if ($indicator eq '*') { }
935 0 6 unless ($length)
942 0 6 unless ($ch =~ /^[\0 \t\r\n\x8520282029?:,\]}%\@]$/)
955 0 8 if ($ch eq '<') { }
0 8 elsif ($ch =~ /^[\0 \t\r\n\x85\x{2028}\x{2029}]$/) { }
959 0 0 if ($self->reader->peek ne '>')
979 8 0 if ($ch eq '!')
987 8 0 if ($use_handle) { }
997 0 8 unless ($ch =~ /^[\0 \r\n\x85\x{2028}\x{2029}]$/)
1021 1 3 if ($style eq '>') { }
1038 4 0 if ($min_indent < 1)
1042 2 2 if (not defined $increment) { }
1044 0 2 $min_indent > $max_indent ? :
1064 8 4 if ($self->reader->column == $indent and $self->reader->peek ne "\000") { }
1070 2 6 if ($folded and $line_break eq "\n" and $leading_non_space and not $self->reader->peek =~ /^[\ \t]$/) { }
1075 2 0 unless (@$breaks)
1101 4 0 if (not defined $chomping or $chomping == 1)
1104 0 4 if (defined $chomping and $chomping == 1)
1126 0 4 if ($ch =~ /^[\+\-]$/) { }
2 2 elsif ($ch =~ /^[0-9]$/) { }
1127 0 0 if ($ch eq '+') { }
1135 0 0 if ($ch =~ /^[0-9]$/)
1137 0 0 if ($increment == 0)
1150 0 2 if ($increment == 0)
1160 0 2 if ($ch =~ /^[\+\-]$/)
1161 0 0 if ($ch eq '+') { }
1171 0 4 unless ($ch =~ /^[\0\ \r\n\x85\x{2028}\x{2029}]$/)
1190 0 4 if ($self->reader->peek eq '#')
1196 0 4 unless ($ch =~ /^[\0\r\n\x85\x{2028}\x{2029}]$/)
1214 0 4 if ($self->reader->peek ne ' ') { }
1220 4 0 if ($self->reader->column > $max_indent)
1258 3 4 if ($style eq '"') { }
1324 21 6 if ($length)
1329 2 25 if (not $double and $ch eq q['] and $self->reader->peek(1) eq q[']) { }
2 23 elsif ($double and $ch eq q['] or not $double and $ch =~ /^[\"\\]$/) { }
4 19 elsif ($double and $ch eq '\\') { }
1340 3 1 if (exists { => ' ', 0 => "\000", L => '2028', N => "\205", P => '2029', \ => '\\', \" => '"', \t => "\t", _ => "\240", a => "\a", b => "\cH", e => "\e", f => "\f", n => "\n", r => "\r", t => "\t", v => "\cK"}->{$ch}) { }
1 0 elsif (exists {U => 8, u => 4, x => 2}->{$ch}) { }
0 0 elsif ($ch =~ /^[\r\n\x85\x{2028}\x{2029}]$/) { }
1348 0 2 unless ($self->reader->peek($k) =~ /^[0123456789ABCDEFabcdef]$/)
1399 0 12 if ($ch eq "\000") { }
8 4 elsif ($ch =~ /^[\r\n\x85\x{2028}\x{2029}]$/) { }
1410 0 8 if ($line_break ne "\n") { }
6 2 elsif (not @$breaks) { }
1435 0 10 if ($prefix eq '---' || $prefix eq '...' and $self->reader->peek(3) =~ /^[\0\ \t\r\n\x85\x{2028}\x{2029}]$/)
1449 2 8 if ($self->reader->peek =~ /^[\r\n\x85\x{2028}\x{2029}]$/) { }
1470 0 66 if ($self->reader->peek eq '#')
1477 36 126 if ($ch =~ /^[\0\ \t\r\n]$/ or not $self->flow_level and $ch eq ':' and $self->reader->peek($length + 1) =~ /^[\0\ \t\r\n]$/ or $self->flow_level and $ch =~ /^[\,\:\?\[\]\{\}]$/)
1489 0 18 if ($self->flow_level and $ch eq ':' and not $self->reader->peek($length + 1) =~ /^[\0\ \t\r\n\,\[\]\{\}]$/)
1500 0 66 if ($length == 0)
1509 27 2 if (not defined $spaces && @$spaces or $self->reader->peek eq '#' or not $self->flow_level and $self->reader->column < $indent)
1541 28 38 if ($ch =~ /$linefeed/) { }
2 36 elsif ($whitespaces) { }
1545 1 27 if ($prefix eq '---' || $prefix eq '...' and $self->reader->peek(3) =~ /$linefeed/)
1552 0 0 if ($self->reader->peek eq ' ') { }
1558 0 0 if ($prefix eq '---' || $prefix eq '...' and $self->reader->peek(3) =~ /$linefeed/)
1565 0 27 if ($line_break ne "\n") { }
27 0 elsif (not @$breaks) { }
1584 0 9 if ($ch ne '!')
1596 9 0 if ($ch ne ' ')
1601 0 9 if ($ch ne '!')
1627 0 110 if ($ch eq '%') { }
1638 9 0 if ($length)
1643 0 9 unless (@$chunks)
1663 102 223 if ($ch =~ /[\r\n]/)
1664 0 102 if ($self->reader->prefix(2) eq "\r\n") { }