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'} ? :
61 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') { }
68 3 210 if exists $TOML::Parser::CONTEXT->{$key}
83 257 62 if ($type eq 'KEY')
100 9 58 if (exists $TOML::Parser::CONTEXT->{$k}) { }
102 7 0 ref $TOML::Parser::CONTEXT->{$k} eq 'HASH' ? :
2 7 ref $TOML::Parser::CONTEXT->{$k} eq 'ARRAY' ? :
118 6 0 if (exists $TOML::Parser::CONTEXT->{$k}) { }
120 0 0 ref $TOML::Parser::CONTEXT->{$k} eq 'HASH' ? :
6 0 ref $TOML::Parser::CONTEXT->{$k} eq 'ARRAY' ? :
128 10 7 unless exists $TOML::Parser::CONTEXT->{$last_key}
129 0 17 unless ref $TOML::Parser::CONTEXT->{$last_key} eq 'ARRAY'
138 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') { }
153 20 137 $is_raw ? :
160 20 0 if (my $token = shift @TOKENS)
162 20 0 if $type eq 'MULTI_LINE_STRING_END'
169 16 46 if $token->[0] eq 'INLINE_TABLE_END'
170 2 44 if $token->[0] eq 'COMMENT'
172 0 44 if exists $data{$key}
182 29 56 if $token->[0] eq 'ARRAY_END'
183 7 49 if $token->[0] eq 'COMMENT'
184 22 27 if ($self->{'strict_mode'})
185 0 22 if defined $last_token and $token->[0] ne $last_token->[0]