Branch Coverage

blib/lib/YAML/yq/Helper.pm
Criterion Covered Total %
branch 0 206 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 =~ /\[\]/) { }
294 0 0 unless (defined $$existing{$yaml->[$int]})
319 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
326 0 0 unless ($self->is_defined("var", $opts{'var'}))
351 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
358 0 0 unless ($self->is_defined("var", $opts{'var'}))
362 0 0 unless ($self->is_array("var", $opts{'var'}))
366 0 0 if ($opts{'var'} =~ /\[\]$/)
391 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
398 0 0 unless ($self->is_defined("var", $opts{'var'}))
402 0 0 unless ($self->is_hash("var", $opts{'var'}))
406 0 0 if ($opts{'var'} =~ /\[\]$/)
427 0 0 unless ($self->{'ensure'})
434 0 0 if ($raw =~ /^\%YANL/)
439 0 0 unless ($raw =~ /^\-\-\-\n/)
446 0 0 unless write_file($self->{'file'}, $raw)
467 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
475 0 0 if ($string =~ /\[\]/) { }
0 0 elsif ($string =~ /\{\}/) { }
0 0 elsif ($string eq "null\n") { }
487 0 0 if ($@)
491 0 0 if (ref $yaml eq "ARRAY")
514 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
521 0 0 unless ($self->is_array("var", $opts{'var'}))
526 0 0 if ($string =~ /\[\]/)
551 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
560 0 0 if ($string eq "null\n")
585 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
594 0 0 if ($string =~ /\[\]/) { }
0 0 elsif ($string =~ /\{\}/) { }
0 0 elsif ($string eq "null\n") { }
606 0 0 if (ref $yaml eq "HASH")
631 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
638 0 0 unless ($self->is_hash("var", $opts{'var'}))
643 0 0 if ($string =~ /\{\}/)
669 0 0 if (not defined $opts{'vals'}) { }
673 0 0 unless (defined $opts{'vals'}[0])
678 0 0 unless (defined $opts{'dedup'})
682 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
689 0 0 if ($opts{'var'} =~ /\[\]$/)
694 0 0 unless ($self->is_array("var", $opts{'var'}))
700 0 0 if ($string =~ /\[\]/) { }
736 0 0 unless (defined $opts{'vals'})
740 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
748 0 0 if ($self->is_defined('var', $opts{'var'})) { }
755 0 0 unless ($opts{'var'} =~ /\[\]$/)
792 0 0 if (not defined $opts{'hash'}) { }
796 0 0 if (ref $opts{'hash'} ne "HASH")
803 0 0 if (defined $opts{'hash'}{$key} and ref $opts{'hash'}{$key} ne "SCALAR" and ref $opts{'hash'}{$key} ne "")
816 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
823 0 0 if ($opts{'var'} =~ /\[\]$/)
827 0 0 unless ($opts{'var'} =~ /\.$/)
832 0 0 if (not $self->is_defined('var', $opts{'var'})) { }
841 0 0 if (defined $opts{'hash'}{$key}) { }
878 0 0 if (not defined $opts{'vals'}) { }
882 0 0 unless (defined $opts{'vals'}[0])
894 0 0 unless (defined $opts{'dedup'})
898 0 0 if (not defined $opts{'var'}) { }
0 0 elsif (not $opts{'var'} =~ /^\./) { }
905 0 0 if ($opts{'var'} =~ /\[\]$/)
910 0 0 if (not $self->is_defined('var', $opts{'var'})) { }
914 0 0 unless ($self->is_array("var", $opts{'var'}))
922 0 0 if ($string =~ /\[\]/) { }
934 0 0 if (defined $$to_exist{$yaml->[$int]})
946 0 0 if ($opts{'dedup'}) { }