Branch Coverage

blib/lib/YAML/Perl/Parser.pm
Criterion Covered Total %
branch 96 138 69.5


line true false branch
97 11 0 if (wantarray) { }
105 0 0 $self->check_event ? :
112 256 228 unless (defined $self->current_event)
113 246 10 if ($self->state)
118 473 10 if (defined $self->current_event)
119 87 386 unless (@choices)
123 139 247 if ($self->current_event->isa($choice))
133 0 74 unless (defined $self->current_event)
134 0 0 if (my $state = $self->state)
143 19 226 unless (defined $self->current_event)
144 19 0 if (my $state = $self->state)
171 2 28 unless ($self->scanner->check_token('YAML::Perl::Token::Directive', 'YAML::Perl::Token::DocumentStart', 'YAML::Perl::Token::StreamEnd'))
200 28 29 if (not $self->scanner->check_token('YAML::Perl::Token::StreamEnd')) { }
204 0 28 unless ($self->scanner->check_token('YAML::Perl::Token::DocumentStart'))
257 0 28 if ($self->scanner->check_token('YAML::Perl::Token::Directive', 'YAML::Perl::Token::DocumentStart', 'YAML::Perl::Token::DocumentEnd', 'YAML::Perl::Token::StreamEnd')) { }
278 1 1 if ($token->name eq 'YAML') { }
1 0 elsif ($token->name eq 'TAG') { }
279 0 1 if (defined $self->yaml_version)
284 0 1 if ($major != 1)
293 0 1 if (defined $self->tag_handles->{$handle})
306 1 27 if (keys %{$self->tag_handles;}) { }
313 55 1 unless (exists $self->tag_handles->{$key})
340 3 105 if ($self->scanner->check_token('YAML::Perl::Token::Alias')) { }
354 3 102 if ($self->scanner->check_token('YAML::Perl::Token::Anchor')) { }
8 94 elsif ($self->scanner->check_token('YAML::Perl::Token::Tag')) { }
360 0 3 if ($self->scanner->check_token('YAML::Perl::Token::Tag'))
373 0 8 if ($self->scanner->check_token('YAML::Perl::Token::Anchor'))
379 8 97 if (defined $tag)
381 8 0 if (defined $handle) { }
382 0 8 unless (exists $self->tag_handles->{$handle})
391 94 11 unless (defined $start_mark)
397 1 104 if ($indentless_sequence and $self->scanner->check_token('YAML::Perl::Token::BlockEntry')) { }
411 74 30 if ($self->scanner->check_token('YAML::Perl::Token::Scalar')) { }
6 24 elsif ($self->scanner->check_token('YAML::Perl::Token::FlowSequenceStart')) { }
4 20 elsif ($self->scanner->check_token('YAML::Perl::Token::FlowMappingStart')) { }
6 14 elsif ($self->scanner->check_token('YAML::Perl::Token::BlockSequenceStart')) { }
14 0 elsif ($self->scanner->check_token('YAML::Perl::Token::BlockMappingStart')) { }
0 0 elsif (defined $anchor or defined $tag) { }
414 59 15 if ($token->plain and not defined $tag or ($tag || '') eq '!') { }
11 4 elsif (not defined $tag) { }
494 0 0 $block ? :
514 18 6 if ($self->scanner->check_token('YAML::Perl::Token::BlockEntry'))
516 18 0 if (not $self->scanner->check_token('YAML::Perl::Token::BlockEntry', 'YAML::Perl::Token::BlockEnd')) { }
528 0 6 unless ($self->scanner->check_token('YAML::Perl::Token::BlockEnd'))
548 2 1 if ($self->scanner->check_token('YAML::Perl::Token::BlockEntry'))
550 2 0 if (not $self->scanner->check_token('YAML::Perl::Token::BlockEntry', 'YAML::Perl::Token::Key', 'YAML::Perl::Token::Value', 'YAML::Perl::Token::BlockEnd')) { }
582 20 14 if ($self->scanner->check_token('YAML::Perl::Token::Key'))
584 20 0 if (not $self->scanner->check_token('YAML::Perl::Token::Key', 'YAML::Perl::Token::Value', 'YAML::Perl::Token::BlockEnd')) { }
597 1 13 unless ($self->scanner->check_token('YAML::Perl::Token::BlockEnd'))
616 20 0 if ($self->scanner->check_token('YAML::Perl::Token::Value')) { }
618 20 0 if (not $self->scanner->check_token('YAML::Perl::Token::Key', 'YAML::Perl::Token::Value', 'YAML::Perl::Token::BlockEnd')) { }
647 6 10 @_ ? :
648 10 6 unless ($self->scanner->check_token('YAML::Perl::Token::FlowSequenceEnd'))
649 6 4 unless ($first)
650 6 0 if ($self->scanner->check_token('YAML::Perl::Token::FlowEntry')) { }
665 4 6 if ($self->scanner->check_token('YAML::Perl::Token::Key')) { }
6 0 elsif (not $self->scanner->check_token('YAML::Perl::Token::FlowSequenceEnd')) { }
696 4 0 if (not $self->scanner->check_token('YAML::Perl::Token::Value', 'YAML::Perl::Token::FlowEntry', 'YAML::Perl::Token::FlowSequenceEnd')) { }
712 4 0 if ($self->scanner->check_token('YAML::Perl::Token::Value')) { }
714 4 0 if (not $self->scanner->check_token('YAML::Perl::Token::FlowEntry', 'YAML::Perl::Token::FlowSequenceEnd')) { }
752 4 2 @_ ? :
754 2 4 unless ($self->scanner->check_token('YAML::Perl::Token::FlowMappingEnd'))
755 0 2 unless ($first)
756 0 0 if ($self->scanner->check_token('YAML::Perl::Token::FlowEntry')) { }
770 2 0 if ($self->scanner->check_token('YAML::Perl::Token::Key')) { }
0 0 elsif (not $self->scanner->check_token('YAML::Perl::Token::FlowMappingEnd')) { }
772 2 0 if (not $self->scanner->check_token('YAML::Perl::Token::Value', 'YAML::Perl::Token::FlowEntry', 'YAML::Perl::Token::FlowMappingEnd')) { }
803 2 0 if ($self->scanner->check_token('YAML::Perl::Token::Value')) { }
805 2 0 if (not $self->scanner->check_token('YAML::Perl::Token::FlowEntry', 'YAML::Perl::Token::FlowMappingEnd')) { }