Branch Coverage

blib/lib/Data/Validate/XSD.pm
Criterion Covered Total %
branch 84 156 53.8


line true false branch
284 2 0 if (-f $filename)
301 6 0 if (defined $$def{'root'} and defined $data) { }
304 0 0 unless defined $$def{'root'}
305 0 0 if not defined $data
317 2 0 if (-f $filename)
352 0 0 if ($e > 0 and $e <= $#errors)
372 3 0 unless $$definition{'simpleTypes'}
373 0 3 unless $$definition{'complexTypes'}
375 0 3 if (defined $$definition{'include'})
376 0 0 if (ref $$definition{'include'} eq 'ARRAY') { }
379 0 0 ref $include ? :
381 0 0 if (defined $$def{'simpleTypes'})
385 0 0 if (defined $$def{'complexTypes'})
424 0 24 unless (UNIVERSAL::isa($definition, 'ARRAY'))
431 53 6 if (UNIVERSAL::isa($element, 'HASH')) { }
6 0 elsif (UNIVERSAL::isa($element, 'ARRAY')) { }
436 0 53 unless $name
438 20 33 unless defined $$element{'minOccurs'}
439 19 34 unless defined $$element{'maxOccurs'}
440 0 53 unless defined $$element{'type'}
449 21 32 if $terrors
455 3 3 $mode eq 'OR' ? :
461 2 4 if $subr and ref $subr
467 3 21 if ($mode eq 'OR')
470 3 3 unless $$errors{$_}
475 9 12 %{$errors;} ? :
494 36 17 if (ref $data ne 'ARRAY' and defined $data)
500 49 4 if ($$definition{'minOccurs'} >= 1)
501 40 9 if (defined $data) { }
502 0 40 if ($$definition{'minOccurs'} > @{$data;})
510 42 2 if (defined $data)
513 40 2 if ($$definition{'maxOccurs'} ne 'unbounded')
514 4 36 if ($$definition{'maxOccurs'} < @{$data;})
521 0 40 if (defined $$definition{'fixed'})
522 0 0 if (ref $element ne '' or $element and $element ne $$definition{'fixed'})
528 0 40 if (defined $$definition{'default'})
529 0 0 unless defined $element
534 10 70 if defined $$definition{$_}
544 8 32 if $result
548 8 32 if (@results > 0)
549 8 0 $proped ? :
567 30 12 if (defined $$definition{'simpleTypes'}{$type}) { }
12 0 elsif (defined $$definition{'complexTypes'}{$type}) { }
572 2 28 if (defined $$typedef{'base'})
577 0 2 if $err
581 0 30 if (defined $$typedef{'pattern'} and ref $$typedef{'pattern'} eq 'REGEX')
582 0 0 unless ($data =~ /$$typedef{'pattern'}/)
588 6 24 if (defined $$typedef{'custom'})
591 0 6 if (ref $method ne 'CODE' or not &$method($data, $typedef))
597 6 24 if (defined $$typedef{'maxLength'})
598 2 4 if (length $data > $$typedef{'maxLength'})
603 4 24 if (defined $$typedef{'minLength'})
604 2 2 if (length $data < $$typedef{'minLength'})
610 0 26 if (defined $$typedef{'match'} or defined $$typedef{'notMatch'})
613 0 0 if ($data ne $result and $$typedef{'match'} or $data eq $result and $$typedef{'notMatch'})
619 0 26 if (defined $$typedef{'enumeration'})
620 0 0 if (ref $$typedef{'enumeration'} ne 'ARRAY')
625 0 0 if $_ eq $data
627 0 0 unless $found
630 3 23 if (looks_like_number $data) { }
0 23 elsif (defined $$typedef{'minInclusive'} or defined $$typedef{'maxInclusive'} or defined $$typedef{'minExclusive'} or defined $$typedef{'maxExclusive'} or defined $$typedef{'fractionDigits'}) { }
631 0 3 if defined $$typedef{'minInclusive'} and $data < $$typedef{'minInclusive'}
632 0 3 if defined $$typedef{'maxInclusive'} and $data > $$typedef{'maxInclusive'}
633 0 3 if defined $$typedef{'minExclusive'} and $data <= $$typedef{'minExclusive'}
634 0 3 if defined $$typedef{'maxExclusive'} and $data >= $$typedef{'maxExclusive'}
646 12 0 if (ref $data eq 'HASH') { }
668 0 0 if ($p{'path'} =~ s[^/][])
674 0 0 if (UNIVERSAL::isa($data, 'HASH')) { }
675 0 0 if (defined $$data{$path}) { }
678 0 0 if $$self{'debug'}
681 0 0 if $$self{'debug'}
697 0 0 unless ($$dest{$key})
717 1 3 if ($content =~ /^<\?xml/) { }
720 1 0 if $@
722 0 0 if ($def and $content =~ /XMLSchema/) { }
729 0 3 if $@
741 6 0 if ($data)
743 6 0 if ($epoch)