Branch Coverage

blib/lib/ENV/Util.pm
Criterion Covered Total %
branch 16 28 57.1


line true false branch
9 4 0 unless defined $cmd
10 0 0 if ($cmd eq '-load_dotenv') { }
22 1 1 unless defined $prefix
30 0 1 unless defined $filename
31 0 1 unless -f $filename
33 0 1 unless open my $fh, "<:raw:encoding(UTF-8)", $filename
41 6 8 if (my($k, $v) = $line =~ / \A\s* (?: export \s+ )? # the 'export' keyword is optional ( [a-zA-Z_][a-zA-Z0-9_]+ ) # POSIX convention for env variable names (?: \s* = \s* ) ( '[^']*(?:\\'|[^']*)*' # single quoted value |"[^"]*(?:\\"|[^"]*)*" # or double quoted value | [^\#\r\n]+ # or unquoted value )? \s* (?: \# .* )? # inline comment \z/sx)
54 0 6 unless defined $v
58 1 5 if ($v =~ s/\A(['"])(.*)\1\z/$2/ and $1 eq "\"")
71 1 0 unless ($opts{'rules'})
88 3 4 if ($rule->{'key'} and $k =~ /$rule->{'key'}/ or $rule->{'value'} and $v =~ /$rule->{'value'}/)
91 3 0 if ($rule->{'key'} and $k =~ /$rule->{'key'}/) { }
0 0 elsif ($rule->{'value'} and $v =~ /$rule->{'value'}/) { }
94 0 3 if $rule->{'drop'}