Branch Coverage

blib/lib/JSON/Schema/Modern/Utilities.pm
Criterion Covered Total %
branch 113 130 86.9


line true false branch
57 71 71484 if ($type eq "null")
60 8127 63357 if ($type eq "boolean")
63 17947 45410 if ($type eq "object")
66 11066 34344 if ($type eq "array")
70 10384 10 if ($type eq "string" or $type eq "number" or $type eq "integer")
71 14 34320 unless defined $value
74 23940 10380 if ($type eq "string")
78 6892 3488 if ($type eq "number")
83 3488 0 if ($type eq "integer")
89 6 4 if ($type =~ /^reference to (.+)$/u)
97 55363 21499 if XXX
98 8763 12736 if is_bool($value)
99 313 12423 unless defined $value
100 1240 11183 if XXX
102 270 124 $value->is_int ? :
3 54 &blessed($value) ? :
394 57 ref($value) =~ /^Math::Big(?:Int|Float)$/u ? :
451 10732 if XXX
107 6012 4720 if $flags & 1024 and not $flags & 768
108 4711 7 int $value == $value ? :
4718 2 if not $flags & 1024 and $flags & 768
122 1568 2837 if ($state->{'scalarref_booleans'})
123 10 1558 if $types[0] eq "reference to SCALAR"
124 17 1551 if $types[1] eq "reference to SCALAR"
127 893 3512 if $types[0] ne $types[1]
128 14 3498 if $types[0] eq "null"
129 1885 1613 if $types[0] eq "string"
130 1083 530 if grep(($types[0] eq $_), ("boolean", "number", "integer"))
133 208 322 if ($types[0] eq "object")
134 16 192 if keys %$x != keys %$y
135 6 186 unless is_equal([sort(keys %$x)], [sort(keys %$y)])
138 86 132 unless is_equal($x->{$property}, $y->{$property}, $state)
143 322 0 if ($types[0] eq "array")
144 8 314 if @$x != @$y
147 88 264 unless is_equal($x->[$idx], $y->[$idx], $state)
160 205 1183 if (is_equal($array->[$idx0], $array->[$idx1], {"scalarref_booleans", 1}))
161 205 0 if defined $equal_indices
173 1 55145 XXX ? :
190 17209 10068 unless @extra_path or length $state->{'schema_path'}
191 1 23595 if @extra_path and XXX
193 13528 10068 @extra_path ? :
194 71 23525 unless length $fragment
209 0 11090 unless defined wantarray
218 8640 2450 if $uri eq "" and $keyword_location eq "" or ($uri->fragment // "") eq $keyword_location and $uri->clone->fragment(undef) eq ""
227 2450 8640 defined $uri ? :
5481 5609 @args ? :
60 11030 $state->{'exception'} ? :
244 8227 2438 if not $state->{'collect_annotations'} or $state->{'spec_version'} eq "draft7"
262 5 2433 $state->{'_unknown'} ? :
274 0 55 if $state->{'traverse'}
279 0 0 unless defined wantarray
280 0 0 unless exists $$schema{$state->{'keyword'}}
285 0 39287 unless defined wantarray
291 0 0 XXX ? :
265 0 XXX ? :
265 39022 if exists $state->{'_schema_path_suffix'}
292 39269 18 if is_type($type, $value)
293 3 15 $type =~ /^[aeiou]/u ? :
297 0 2285 unless defined wantarray
308 0 4424 unless defined wantarray
313 26 1803 if fc "Mojo::URL"->new($string)->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u or $string =~ /#/u and not $string =~ /#$/u and not $string =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u and not $string =~ m[#/(?:[^~]|~[01])*$]u
325 0 5737 unless defined wantarray
330 4 0 if fc $uri->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u or not $uri->is_abs or $string =~ /#/u and not $string =~ /#$/u and not $string =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u and not $string =~ m[#/(?:[^~]|~[01])*$]u
346 82 1526 XXX ? :
351 66 1035 ref($value) =~ /^Math::Big(?:Int|Float)$/u ? :