Branch Coverage

blib/lib/YAML/yq/Helper.pm
Criterion Covered Total %
branch 0 212 0.0


line true false branch
49 0 0 if ($? != 0)
53 0 0 unless (defined $opts{'file'})
57 0 0 unless (-e $opts{'file'})
61 0 0 unless (-f $opts{'file'})
65 0 0 unless (-r $opts{'file'})
78 0 0 if ($raw =~ /^\%YAML\ 1\.1/) { }
0 0 elsif ($raw =~ /^\%YAML\ 1\.1/) { }
106 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
113 0 0 if ($self->is_array_clear("var", $opts{'var'}))
117 0 0 unless ($opts{'var'} =~ /\[\]$/)
142 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
149 0 0 if ($self->is_hash_clear("var", $opts{'var'}))
153 0 0 unless ($opts{'var'} =~ /\[\]$/)
180 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
188 0 0 if (not $self->is_defined('var', $opts{'var'})) { }
195 0 0 unless ($opts{'var'} =~ /\[\]$/)
225 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
233 0 0 if (not $self->is_defined('var', $opts{'var'})) { }
260 0 0 unless (defined $opts{'dedup'})
264 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
271 0 0 if ($opts{'var'} =~ /\[\]$/)
276 0 0 unless ($self->is_array("var", $opts{'var'}))
282 0 0 if ($string =~ /\[\]/) { }
288 0 0 unless eval { do { $yaml = Load($string) } }
295 0 0 unless (defined $$existing{$yaml->[$int]})
320 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
327 0 0 unless ($self->is_defined("var", $opts{'var'}))
352 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
359 0 0 unless ($self->is_defined("var", $opts{'var'}))
363 0 0 unless ($self->is_array("var", $opts{'var'}))
367 0 0 if ($opts{'var'} =~ /\[\]$/)
392 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
399 0 0 unless ($self->is_defined("var", $opts{'var'}))
403 0 0 unless ($self->is_hash("var", $opts{'var'}))
407 0 0 if ($opts{'var'} =~ /\[\]$/)
428 0 0 unless ($self->{'ensure'})
435 0 0 if ($raw =~ /^\%YANL/)
440 0 0 unless ($raw =~ /^\-\-\-\n/)
447 0 0 unless write_file($self->{'file'}, $raw)
468 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
476 0 0 if ($string =~ /\[\]/) { }
0 0 elsif ($string =~ /\{\}/) { }
0 0 elsif ($string eq "null\n") { }
488 0 0 if ($@)
491 0 0 if (ref $yaml->{'foo'} eq "ARRAY")
497 0 0 if (ref $yaml eq "ARRAY")
520 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
527 0 0 unless ($self->is_array("var", $opts{'var'}))
532 0 0 if ($string =~ /\[\]/)
557 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
566 0 0 if ($string eq "null\n")
591 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
600 0 0 if ($string =~ /\[\]/) { }
0 0 elsif ($string =~ /\{\}/) { }
0 0 elsif ($string eq "null\n") { }
612 0 0 if (ref $yaml eq "HASH")
637 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
644 0 0 unless ($self->is_hash("var", $opts{'var'}))
649 0 0 if ($string =~ /\{\}/)
675 0 0 if (not defined $opts{'vals'}) { }
679 0 0 unless (defined $opts{'vals'}[0])
684 0 0 unless (defined $opts{'dedup'})
688 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
695 0 0 if ($opts{'var'} =~ /\[\]$/)
700 0 0 unless ($self->is_array("var", $opts{'var'}))
706 0 0 if ($string =~ /\[\]/) { }
712 0 0 unless eval { do { $yaml = Load($string) } }
743 0 0 unless (defined $opts{'vals'})
747 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
755 0 0 if ($self->is_defined('var', $opts{'var'})) { }
762 0 0 unless ($opts{'var'} =~ /\[\]$/)
799 0 0 if (not defined $opts{'hash'}) { }
803 0 0 if (ref $opts{'hash'} ne "HASH")
810 0 0 if (defined $opts{'hash'}{$key} and ref $opts{'hash'}{$key} ne "SCALAR" and ref $opts{'hash'}{$key} ne "")
823 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
830 0 0 if ($opts{'var'} =~ /\[\]$/)
834 0 0 unless ($opts{'var'} =~ /\.$/)
839 0 0 if (not $self->is_defined('var', $opts{'var'})) { }
848 0 0 if (defined $opts{'hash'}{$key}) { }
885 0 0 if (not defined $opts{'vals'}) { }
889 0 0 unless (defined $opts{'vals'}[0])
901 0 0 unless (defined $opts{'dedup'})
905 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
912 0 0 if ($opts{'var'} =~ /\[\]$/)
917 0 0 if (not $self->is_defined('var', $opts{'var'})) { }
921 0 0 unless ($self->is_array("var", $opts{'var'}))
929 0 0 if ($string =~ /\[\]/) { }
941 0 0 if (defined $$to_exist{$yaml->[$int]})
953 0 0 if ($opts{'dedup'}) { }