Branch Coverage

blib/lib/JSON/Schema/Modern/Vocabulary/Core.pm
Criterion Covered Total %
branch 106 118 89.8


line true false branch
35 20 180 $spec_version eq 'draft4' ? :
136 64 !($spec_version =~ /^draft[467]\z/u) ? :
44 156 $spec_version eq 'draft2019-09' ? :
92 108 !($spec_version =~ /^draft(?:[467]|2019-09)\z/u) ? :
44 156 $spec_version eq 'draft2019-09' ? :
92 108 !($spec_version =~ /^draft(?:[467]|2019-09)\z/u) ? :
136 64 !($spec_version =~ /^draft[467]\z/u) ? :
64 136 $spec_version =~ /^draft[467]\z/u ? :
167 33 !($spec_version =~ /^draft[46]\z/u) ? :
55 2 2151 unless assert_keyword_type($state, $schema, "string") and assert_uri_reference($state, $schema)
60 98 2053 if (length $uri->fragment)
62 4 94 unless $$state{"specification_version"} =~ /^draft[467]\z/u
64 15 79 if (length(my $base = $uri->clone->fragment(undef)))
66 2 13 if $$state{"specification_version"} =~ /^draft[67]\z/u
69 0 13 unless $class->__create_identifier($base, $state)
75 26 2027 unless $class->__create_identifier($uri, $state)
81 24 2042 unless length $uri
83 740 1302 unless $uri->is_abs
87 2 2040 if exists $$state{"identifiers"}{$uri}
109 65 2643 if $$state{"specification_version"} =~ /^draft[467]\z/u and $$schema{$$state{"keyword"}} =~ /^#/u
114 0 2643 unless $schema_info
119 0 2643 if $$schema_info{"document"} != $$state{"document"}
129 157 2486 if $$state{"dynamic_scope"}[-1] ne $$schema_info{"canonical_uri"}
140 2 5955 unless is_type("string", $$schema{"\$schema"})
141 3 5952 unless assert_uri($state, $schema, $$schema{"\$schema"})
145 5895 57 if (my $metaschema_info = $$state{'evaluator'}->_get_metaschema_vocabulary_classes($$schema{'$schema'})) { }
150 2 55 unless $schema_info
153 1 54 if $$schema_info{"document"}->get_entity_at_location($$schema_info{"document_path"}) ne "schema"
155 1 53 if (ref $$schema_info{'schema'} ne 'HASH') { }
166 20 5929 unless $vocabularies and @$vocabularies
175 11 5918 $spec_version eq 'draft4' ? :
4 5925 if not exists $$schema{$spec_version eq "draft4" ? "id" : "\$id"} and length $$state{"keyword_path"}
183 1 5924 if exists $$schema{"\$ref"} and $spec_version =~ /^draft[467]\z/u
199 0 602 unless assert_keyword_type($state, $schema, "string")
205 6 592 if $$state{"specification_version"} =~ /^draft[467]\z/u and not $anchor =~ /^#[A-Za-z][A-Za-z0-9_:.-]*\z/u or $$state{"specification_version"} eq "draft2019-09" and not $anchor =~ /^[A-Za-z][A-Za-z0-9_:.-]*\z/u or $$state{"specification_version"} eq "draft2020-12" and not $anchor =~ /^[A-Za-z_][A-Za-z0-9._-]*\z/u
209 88 504 if $$state{"specification_version"} =~ /^draft[467]\z/u
213 508 84 if (exists $$state{'identifiers'}{$base_uri}) { }
216 1 507 if exists(($$state{"identifiers"}{$base_uri}{"anchors"} // {})->{$anchor})
229 77 7 if (my $fragment = $canonical_uri->fragment)
232 0 77 if substr($$state{"traversed_keyword_path"} . $$state{"keyword_path"}, -length($fragment)) ne $fragment
263 0 182 unless assert_keyword_type($state, $schema, "boolean")
268 3 179 if length $$state{"keyword_path"}
273 303 76 if not $$schema{"\$recursiveAnchor"} or exists $$state{"recursive_anchor_uri"}
282 0 296 unless $class->_traverse_keyword_anchor($schema, $state)
290 32 3701 unless assert_keyword_type($state, $schema, "string") and assert_uri_reference($state, $schema)
298 3125 576 if $$state{"references"}
313 0 108 unless $schema_info
315 1 107 if $$schema_info{"document"}->get_entity_at_location($$schema_info{"document_path"}) ne "schema"
317 62 41 if (ref $$schema_info{"schema"} eq "HASH" and is_type("boolean", $$schema_info{"schema"}{"\$recursiveAnchor"}) and $$schema_info{"schema"}{"\$recursiveAnchor"})
332 0 214 unless $schema_info
334 1 213 if $$schema_info{"document"}->get_entity_at_location($$schema_info{"document_path"}) ne "schema"
338 175 25 if (length $uri->fragment and ref $$schema_info{"schema"} eq "HASH" and exists $$schema_info{"schema"}{"\$dynamicAnchor"} and $uri->fragment eq (my $anchor = $$schema_info{"schema"}{"\$dynamicAnchor"}))
347 0 234 unless $resource
348 170 64 if (exists(($$resource{"anchors"} // {})->{$anchor}) and $$resource{"anchors"}{$anchor}{"dynamic"})
364 0 102 unless assert_keyword_type($state, $schema, "object")
367 1 101 if length $$state{"keyword_path"}
373 5 244 unless (is_type("boolean", $$schema{"\$vocabulary"}{$uri}))
379 13 231 unless assert_uri({%$state, "_keyword_path_suffix", $uri}, undef, $uri)
398 0 650 unless assert_keyword_type($state, $schema, "string")