Branch Coverage

blib/lib/Data/Section/Writer.pm
Criterion Covered Total %
branch 35 50 70.0


line true false branch
22 2 3 unless (defined $self->perl_filename)
28 5 0 unless (is_blessed_ref($self->perl_filename) and $self->isa("Path::Tiny"))
39 0 7 if defined $encoding and $encoding ne "base64"
46 10 13 if defined $data->[1]
51 1 22 if ($filename =~ /\.(.*?)\z/u and @{$self->_formats->{$1} // []})
56 10 13 if (defined $data->[1] and $data->[1] eq 'base64') { }
68 2 11 unless %$files
81 8 1 if (-f $self->perl_filename) { }
84 1 7 if ($perl =~ /^__DATA__/u) { }
92 2 5 unless $perl =~ /\n\z/su
101 1 8 if (defined $orig and $orig eq $perl) { }
108 7 1 if (-f $self->perl_filename) { }
112 7 0 if -f $self->perl_filename
115 0 7 unless print $fh $perl
117 7 0 if -f $backup
132 0 1 unless is_coderef($cb)
139 0 1 unless $name =~ /^[a-z][a-z0-9_]+\z/u
145 0 1 unless $self->_valid_plugin($class)
148 0 1 if ($class->can('new')) { }
151 0 1 if (%args)
157 0 1 unless $self->_valid_plugin($plugin)
160 1 0 if ($plugin->does("Data::Section::Pluggable::Role::FormatContentPlugin"))
163 0 1 if is_plain_arrayref($extensions[0])
165 0 1 unless @extensions
178 2 0 if $plugin->can("does")