Branch Coverage

blib/lib/TOML/Parser.pm
Criterion Covered Total %
branch 55 72 76.3


line true false branch
16 0 56 @_ == 1 && ref $_[0] eq 'HASH' ? :
19 4 0 $_[0] eq 'true' ? :
27 0 0 unless open my $fh, '<:encoding(utf-8)', $file
39 15 41 $self->{'strict_mode'} ? :
68 40 292 if ($type eq 'TABLE') { }
17 275 elsif ($type eq 'ARRAY_OF_TABLE') { }
213 62 elsif (my($key, $value) = $self->_parse_key_and_value($token)) { }
62 0 elsif ($type eq 'COMMENT') { }
75 3 210 if exists $TOML::Parser::CONTEXT->{$key}
90 257 62 if ($type eq 'KEY')
107 9 58 if (exists $TOML::Parser::CONTEXT->{$k}) { }
109 7 0 ref $TOML::Parser::CONTEXT->{$k} eq 'HASH' ? :
2 7 ref $TOML::Parser::CONTEXT->{$k} eq 'ARRAY' ? :
127 6 0 if (exists $TOML::Parser::CONTEXT->{$k}) { }
129 0 0 ref $TOML::Parser::CONTEXT->{$k} eq 'HASH' ? :
6 0 ref $TOML::Parser::CONTEXT->{$k} eq 'ARRAY' ? :
137 10 7 unless exists $TOML::Parser::CONTEXT->{$last_key}
138 0 17 unless ref $TOML::Parser::CONTEXT->{$last_key} eq 'ARRAY'
149 0 326 if ($type eq 'COMMENT') { }
98 228 elsif ($type eq 'INTEGER' or $type eq 'FLOAT') { }
4 224 elsif ($type eq 'BOOLEAN') { }
2 222 elsif ($type eq 'DATETIME') { }
157 65 elsif ($type eq 'STRING') { }
20 45 elsif ($type eq 'MULTI_LINE_STRING_BEGIN') { }
16 29 elsif ($type eq 'INLINE_TABLE_BEGIN') { }
29 0 elsif ($type eq 'ARRAY_BEGIN') { }
164 20 137 $is_raw ? :
171 20 0 if (my $token = shift @TOKENS)
173 20 0 if $type eq 'MULTI_LINE_STRING_END'
180 16 46 if $token->[0] eq 'INLINE_TABLE_END'
181 2 44 if $token->[0] eq 'COMMENT'
183 0 44 if exists $data{$key}
193 29 56 if $token->[0] eq 'ARRAY_END'
194 7 49 if $token->[0] eq 'COMMENT'
195 22 27 if ($self->{'strict_mode'})
196 0 22 if defined $last_token and $token->[0] ne $last_token->[0]