Branch Coverage

blib/lib/Crypt/SecretBuffer.pm
Criterion Covered Total %
branch 33 106 31.1


line true false branch
48 3 1 if (@_)
60 22 0 if (@_ and ref $_[0] and ref $_[0] eq 'GLOB' || ref($_[0])->can('getc')) { }
61 0 22 unless @_ & 1
64 0 0 if @_ & 1
70 0 22 if keys %options
73 0 22 unless (defined $input_fh)
75 0 0 if ($^O eq 'MSWin32') { }
76 0 0 unless open $input_fh, "+<", "CONIN\$"
77 0 0 unless defined $prompt_fh
82 0 0 unless open $input_fh, "+<", "/dev/tty"
83 0 0 unless defined $prompt_fh
87 0 22 if (not defined $prompt_fh and defined $prompt || defined $char_mask)
93 0 0 if (-t $input_fh and defined $fd && $fd == 0 || \*STDIN == $input_fh || $^O eq 'MSWin32') { }
0 0 elsif (-S $input_fh or -t $input_fh) { }
94 0 0 if ($^O eq 'MSWin32') { }
95 0 0 unless open $prompt_fh, ">", "CONOUT\$"
98 0 0 unless open $prompt_fh, "+<", "/dev/tty"
127 0 22 if (defined $prompt)
128 0 0 unless $prompt_fh->print($prompt) and $prompt_fh->flush
133 0 22 if ($input_by_chars) { }
135 0 0 unless $ret = $self->append_read($input_fh, 1)
139 0 0 if ($self->index(qr/[\0-\x1F\x7F]/, $end_pos) == $end_pos) { }
0 0 elsif ($char_class and $self->index($char_class, $end_pos) == -1) { }
0 0 elsif ($char_max and $self->length - $start_len > $char_max) { }
143 0 0 if ($self->index(qr/[\r\n]/, $end_pos) == $end_pos) { }
0 0 elsif ($self->index(qr/[\b\x7F]/, $end_pos) == $end_pos) { }
150 0 0 if ($self->length > $start_len)
153 0 0 if (CORE::length $char_mask)
154 0 0 unless $prompt_fh->print("\b" x CORE::length($char_mask) . " " x CORE::length($char_mask) . "\b" x CORE::length($char_mask)) and $prompt_fh->flush
178 0 0 if (CORE::length $char_mask)
179 0 0 unless $prompt_fh->print($char_mask) and $prompt_fh->flush
183 0 0 if $char_count and $self->length - $start_len == $char_count
189 0 22 if ($char_max and $self->length - $start_len > $char_max)
196 0 22 if defined $prompt
199 0 17 $char_count ? :
5 17 !$ret ? :
207 0 2 unless pipe my $r, my $w
216 0 1 unless open my $fh, "<", $path
218 0 1 unless ($chunksize)
225 0 2 unless defined $got
226 1 1 if $got == 0
231 0 1 unless close $fh
240 1 2 if (not $overwrite) { }
1 1 elsif ($overwrite eq 'rename') { }
241 1 0 if -e $path
243 0 0 unless open $fh, ">>", $path
244 0 0 if -s $fh > 0
251 1 0 CORE::length $dest_dir ? :
254 0 1 unless open $fh, ">", $path
259 0 2 unless defined $w
262 0 2 unless close $fh
263 1 1 if ($overwrite eq "rename")
264 0 1 unless rename $cur_path, $path