Branch Coverage

blib/lib/Venus/Role/Optional.pm
Criterion Covered Total %
branch 83 100 83.0


line true false branch
15 0 8 unless $name
23 0 2 unless $name
25 1 1 exists $self->{$name} ? :
31 0 5 unless $name and $self->can($name)
46 63 39 exists $data->{$name} ? :
58 69 31 if exists $data->{$name}
61 69 31 if exists $data->{$name}
64 69 31 if exists $data->{$name}
86 0 79 unless $name
88 68 11 !@data ? :
163 12 161 if (my $code = $self->can("assert_$name") and @data)
169 12 0 @data ? :
171 0 12 if (&Scalar::Util::blessed($return)) { }
12 0 elsif (length $return) { }
172 0 0 if ($return->isa('Venus::Assert')) { }
207 24 122 if (my $code = $self->can("build_$name"))
208 8 16 @data ? :
209 24 0 if @return
211 72 74 @data ? :
217 8 169 if (my $code = $self->can("check_$name") and @data)
225 1 7 unless (&$code($self, @data))
235 24 3 if (my $code = $self->can("coerce_$name") and @data || exists $self->{$name})
238 6 18 @data ? :
241 24 0 $package->can('DOES') && $package->DOES('Venus::Role::Assertable') ? :
243 15 9 if not &Scalar::Util::blessed($value) or &Scalar::Util::blessed($value) and not $value->isa($return)
247 66 65 @data ? :
253 16 154 if (my $code = $self->can("default_$name") and not @data)
254 6 10 unless exists $self->{$name}
262 1 101 if (my $code = $self->can("initial_$name"))
271 4 73 if (my $code = $self->can("lazy_build_$name"))
272 0 4 @data ? :
273 4 0 if @return
275 9 68 @data ? :
281 2 66 if (my $code = $self->can("read_$name") and not @data) { }
292 1 9 if (my $code = $self->can("readonly_$name") || $self->can('readonly'))
300 1 0 if (&$code($self, @data))
310 1 10 if (my $code = $self->can("readwrite_$name") || $self->can('readwrite'))
318 1 0 unless (&$code($self, @data))
328 6 96 if (my $code = $self->can("require_$name"))
336 2 4 if (&$code($self, @data) and not @data)
346 15 161 if (my $code = $self->can("self_assert_$name") and @data)
347 15 0 @data ? :
3 12 if (my $error = &catch(sub { &$code($self, @data ? $data[0] : $self->{$name}); } ))
348 2 1 if (do { require Scalar::Util; &Scalar::Util::blessed($error) }) { }
349 1 1 $error->isa('Venus::Error') ? :
362 10 0 if (my $code = $self->can("self_coerce_$name") and @data || exists $self->{$name})
363 2 8 @data ? :
365 71 65 @data ? :
371 2 74 if (my $code = $self->can("trigger_$name"))
380 2 7 if (my $code = $self->can("write_$name")) { }