lib/LIVR/Contract.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
condition | 8 | 12 | 66.6 |
line | l | !l | condition |
---|---|---|---|
118 | 1 | 2 | $$self{'input_preparator'} ||= sub { my %numbered; for (my $i = 0; $i < @_; ++$i) { $numbered{$i} = $_[$i]; }; my %named; for (my $i = @_ % 2; $i < @_; $i += 2) { if (ref $_[$i]) { undef %named; last; } else { $named{$_[$i]} = $_[$i + 1]; }; }; return {%numbered, %named}; } |
132 | 0 | 1 | $$self{'output_preparator'} ||= sub { my %numbered; for (my $i = 0; $i < @_; ++$i) { $numbered{$i} = $_[$i]; }; return \%numbered; } |
150 | 1 | 2 | $$self{'on_fail'} ||= sub { my($type, $package, $subname, $errors) = @_; local $Carp::Internal{'LIVR::Contract'} = 1; die 'LIVR::Contract::Exception'->new('type', $type, 'package', $package, 'subname', $subname, 'errors', $errors); } |
line | l | !l&&r | !l&&!r | condition |
---|---|---|---|---|
80 | 1 | 2 | 0 | $$self{'input_validator'} ||= 'Validator::LIVR'->new($$self{'requires'})->prepare |
91 | 0 | 1 | 0 | $$self{'output_validator'} ||= 'Validator::LIVR'->new($$self{'ensures'})->prepare |