55#include < sourcemeta/jsonbinpack/compiler.h>
66
77TEST (JSONBinPack_Canonicalizer_Any_2020_12, if_without_then_else_1) {
8- auto schema = sourcemeta::core::parse (R"JSON( {
8+ auto schema = sourcemeta::core::parse_json (R"JSON( {
99 "$schema": "https://json-schema.org/draft/2020-12/schema",
1010 "type": "object",
1111 "if": { "minProperties": 2 }
1212 })JSON" );
1313
14- sourcemeta::jsonbinpack::canonicalize (schema,
15- sourcemeta::core::default_schema_walker ,
16- sourcemeta::core::official_resolver);
14+ sourcemeta::jsonbinpack::canonicalize (
15+ schema, sourcemeta::core::schema_official_walker ,
16+ sourcemeta::core::official_resolver);
1717
18- const auto expected = sourcemeta::core::parse (R"JSON( {
18+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
1919 "$schema": "https://json-schema.org/draft/2020-12/schema",
2020 "type": "object",
2121 "minProperties": 0,
@@ -26,18 +26,18 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, if_without_then_else_1) {
2626}
2727
2828TEST (JSONBinPack_Canonicalizer_Any_2020_12, then_else_without_if_1) {
29- auto schema = sourcemeta::core::parse (R"JSON( {
29+ auto schema = sourcemeta::core::parse_json (R"JSON( {
3030 "$schema": "https://json-schema.org/draft/2020-12/schema",
3131 "type": "object",
3232 "then": { "minProperties": 2 },
3333 "else": { "minProperties": 3 }
3434 })JSON" );
3535
36- sourcemeta::jsonbinpack::canonicalize (schema,
37- sourcemeta::core::default_schema_walker ,
38- sourcemeta::core::official_resolver);
36+ sourcemeta::jsonbinpack::canonicalize (
37+ schema, sourcemeta::core::schema_official_walker ,
38+ sourcemeta::core::official_resolver);
3939
40- const auto expected = sourcemeta::core::parse (R"JSON( {
40+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
4141 "$schema": "https://json-schema.org/draft/2020-12/schema",
4242 "type": "object",
4343 "minProperties": 0,
@@ -48,7 +48,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, then_else_without_if_1) {
4848}
4949
5050TEST (JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_1) {
51- auto schema = sourcemeta::core::parse (R"JSON( {
51+ auto schema = sourcemeta::core::parse_json (R"JSON( {
5252 "$schema": "https://json-schema.org/draft/2020-12/schema",
5353 "allOf": [
5454 { "type": "number" },
@@ -57,11 +57,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_1) {
5757 ]
5858 })JSON" );
5959
60- sourcemeta::jsonbinpack::canonicalize (schema,
61- sourcemeta::core::default_schema_walker ,
62- sourcemeta::core::official_resolver);
60+ sourcemeta::jsonbinpack::canonicalize (
61+ schema, sourcemeta::core::schema_official_walker ,
62+ sourcemeta::core::official_resolver);
6363
64- const auto expected = sourcemeta::core::parse (R"JSON( {
64+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
6565 "$schema": "https://json-schema.org/draft/2020-12/schema",
6666 "allOf": [
6767 { "type": "number", "multipleOf": 1 },
@@ -73,7 +73,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_1) {
7373}
7474
7575TEST (JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_2) {
76- auto schema = sourcemeta::core::parse (R"JSON( {
76+ auto schema = sourcemeta::core::parse_json (R"JSON( {
7777 "$schema": "https://json-schema.org/draft/2020-12/schema",
7878 "allOf": [
7979 { "type": "number" },
@@ -82,11 +82,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_2) {
8282 ]
8383 })JSON" );
8484
85- sourcemeta::jsonbinpack::canonicalize (schema,
86- sourcemeta::core::default_schema_walker ,
87- sourcemeta::core::official_resolver);
85+ sourcemeta::jsonbinpack::canonicalize (
86+ schema, sourcemeta::core::schema_official_walker ,
87+ sourcemeta::core::official_resolver);
8888
89- const auto expected = sourcemeta::core::parse (R"JSON( {
89+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
9090 "$schema": "https://json-schema.org/draft/2020-12/schema",
9191 "allOf": [
9292 { "type": "number", "multipleOf": 1 },
@@ -98,7 +98,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_2) {
9898}
9999
100100TEST (JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_3) {
101- auto schema = sourcemeta::core::parse (R"JSON( {
101+ auto schema = sourcemeta::core::parse_json (R"JSON( {
102102 "$schema": "https://json-schema.org/draft/2020-12/schema",
103103 "allOf": [
104104 { "type": "number" },
@@ -114,11 +114,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_3) {
114114 ]
115115 })JSON" );
116116
117- sourcemeta::jsonbinpack::canonicalize (schema,
118- sourcemeta::core::default_schema_walker ,
119- sourcemeta::core::official_resolver);
117+ sourcemeta::jsonbinpack::canonicalize (
118+ schema, sourcemeta::core::schema_official_walker ,
119+ sourcemeta::core::official_resolver);
120120
121- const auto expected = sourcemeta::core::parse (R"JSON( {
121+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
122122 "$schema": "https://json-schema.org/draft/2020-12/schema",
123123 "allOf": [
124124 { "type": "number", "multipleOf": 1 },
@@ -130,7 +130,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_3) {
130130}
131131
132132TEST (JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_1) {
133- auto schema = sourcemeta::core::parse (R"JSON( {
133+ auto schema = sourcemeta::core::parse_json (R"JSON( {
134134 "$schema": "https://json-schema.org/draft/2020-12/schema",
135135 "anyOf": [
136136 { "type": "number" },
@@ -139,11 +139,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_1) {
139139 ]
140140 })JSON" );
141141
142- sourcemeta::jsonbinpack::canonicalize (schema,
143- sourcemeta::core::default_schema_walker ,
144- sourcemeta::core::official_resolver);
142+ sourcemeta::jsonbinpack::canonicalize (
143+ schema, sourcemeta::core::schema_official_walker ,
144+ sourcemeta::core::official_resolver);
145145
146- const auto expected = sourcemeta::core::parse (R"JSON( {
146+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
147147 "$schema": "https://json-schema.org/draft/2020-12/schema",
148148 "anyOf": [
149149 { "type": "number", "multipleOf": 1 },
@@ -155,7 +155,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_1) {
155155}
156156
157157TEST (JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_2) {
158- auto schema = sourcemeta::core::parse (R"JSON( {
158+ auto schema = sourcemeta::core::parse_json (R"JSON( {
159159 "$schema": "https://json-schema.org/draft/2020-12/schema",
160160 "anyOf": [
161161 { "type": "number" },
@@ -164,11 +164,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_2) {
164164 ]
165165 })JSON" );
166166
167- sourcemeta::jsonbinpack::canonicalize (schema,
168- sourcemeta::core::default_schema_walker ,
169- sourcemeta::core::official_resolver);
167+ sourcemeta::jsonbinpack::canonicalize (
168+ schema, sourcemeta::core::schema_official_walker ,
169+ sourcemeta::core::official_resolver);
170170
171- const auto expected = sourcemeta::core::parse (R"JSON( {
171+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
172172 "$schema": "https://json-schema.org/draft/2020-12/schema",
173173 "anyOf": [
174174 { "type": "number", "multipleOf": 1 },
@@ -180,7 +180,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_2) {
180180}
181181
182182TEST (JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_3) {
183- auto schema = sourcemeta::core::parse (R"JSON( {
183+ auto schema = sourcemeta::core::parse_json (R"JSON( {
184184 "$schema": "https://json-schema.org/draft/2020-12/schema",
185185 "anyOf": [
186186 { "type": "number" },
@@ -196,11 +196,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_3) {
196196 ]
197197 })JSON" );
198198
199- sourcemeta::jsonbinpack::canonicalize (schema,
200- sourcemeta::core::default_schema_walker ,
201- sourcemeta::core::official_resolver);
199+ sourcemeta::jsonbinpack::canonicalize (
200+ schema, sourcemeta::core::schema_official_walker ,
201+ sourcemeta::core::official_resolver);
202202
203- const auto expected = sourcemeta::core::parse (R"JSON( {
203+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
204204 "$schema": "https://json-schema.org/draft/2020-12/schema",
205205 "anyOf": [
206206 { "type": "number", "multipleOf": 1 },
@@ -212,16 +212,16 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_3) {
212212}
213213
214214TEST (JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_1) {
215- auto schema = sourcemeta::core::parse (R"JSON( {
215+ auto schema = sourcemeta::core::parse_json (R"JSON( {
216216 "$schema": "https://json-schema.org/draft/2020-12/schema",
217217 "type": [ "object", "array" ]
218218 })JSON" );
219219
220- sourcemeta::jsonbinpack::canonicalize (schema,
221- sourcemeta::core::default_schema_walker ,
222- sourcemeta::core::official_resolver);
220+ sourcemeta::jsonbinpack::canonicalize (
221+ schema, sourcemeta::core::schema_official_walker ,
222+ sourcemeta::core::official_resolver);
223223
224- const auto expected = sourcemeta::core::parse (R"JSON( {
224+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
225225 "$schema": "https://json-schema.org/draft/2020-12/schema",
226226 "anyOf": [
227227 {
@@ -240,17 +240,17 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_1) {
240240}
241241
242242TEST (JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_2) {
243- auto schema = sourcemeta::core::parse (R"JSON( {
243+ auto schema = sourcemeta::core::parse_json (R"JSON( {
244244 "$schema": "https://json-schema.org/draft/2020-12/schema",
245245 "type": [ "object", "array" ],
246246 "maxProperties": 3
247247 })JSON" );
248248
249- sourcemeta::jsonbinpack::canonicalize (schema,
250- sourcemeta::core::default_schema_walker ,
251- sourcemeta::core::official_resolver);
249+ sourcemeta::jsonbinpack::canonicalize (
250+ schema, sourcemeta::core::schema_official_walker ,
251+ sourcemeta::core::official_resolver);
252252
253- const auto expected = sourcemeta::core::parse (R"JSON( {
253+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
254254 "$schema": "https://json-schema.org/draft/2020-12/schema",
255255 "anyOf": [
256256 {
@@ -270,7 +270,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_2) {
270270}
271271
272272TEST (JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_3) {
273- auto schema = sourcemeta::core::parse (R"JSON( {
273+ auto schema = sourcemeta::core::parse_json (R"JSON( {
274274 "$schema": "https://json-schema.org/draft/2020-12/schema",
275275 "type": "object",
276276 "properties": {
@@ -280,11 +280,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_3) {
280280 }
281281 })JSON" );
282282
283- sourcemeta::jsonbinpack::canonicalize (schema,
284- sourcemeta::core::default_schema_walker ,
285- sourcemeta::core::official_resolver);
283+ sourcemeta::jsonbinpack::canonicalize (
284+ schema, sourcemeta::core::schema_official_walker ,
285+ sourcemeta::core::official_resolver);
286286
287- const auto expected = sourcemeta::core::parse (R"JSON( {
287+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
288288 "$schema": "https://json-schema.org/draft/2020-12/schema",
289289 "type": "object",
290290 "minProperties": 0,
@@ -309,15 +309,15 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_3) {
309309}
310310
311311TEST (JSONBinPack_Canonicalizer_Any_2020_12, implicit_type_union_1) {
312- auto schema = sourcemeta::core::parse (R"JSON( {
312+ auto schema = sourcemeta::core::parse_json (R"JSON( {
313313 "$schema": "https://json-schema.org/draft/2020-12/schema"
314314 })JSON" );
315315
316- sourcemeta::jsonbinpack::canonicalize (schema,
317- sourcemeta::core::default_schema_walker ,
318- sourcemeta::core::official_resolver);
316+ sourcemeta::jsonbinpack::canonicalize (
317+ schema, sourcemeta::core::schema_official_walker ,
318+ sourcemeta::core::official_resolver);
319319
320- const auto expected = sourcemeta::core::parse (R"JSON( {
320+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
321321 "$schema": "https://json-schema.org/draft/2020-12/schema",
322322 "anyOf": [
323323 { "enum": [ null ] },
@@ -353,11 +353,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, boolean_schema_1) {
353353 sourcemeta::core::JSON schema{true };
354354
355355 sourcemeta::jsonbinpack::canonicalize (
356- schema, sourcemeta::core::default_schema_walker ,
356+ schema, sourcemeta::core::schema_official_walker ,
357357 sourcemeta::core::official_resolver,
358358 " https://json-schema.org/draft/2020-12/schema" );
359359
360- const auto expected = sourcemeta::core::parse (R"JSON( {
360+ const auto expected = sourcemeta::core::parse_json (R"JSON( {
361361 "anyOf": [
362362 { "enum": [ null ] },
363363 { "enum": [ false, true ] },
@@ -392,7 +392,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, boolean_schema_2) {
392392 sourcemeta::core::JSON schema{false };
393393
394394 sourcemeta::jsonbinpack::canonicalize (
395- schema, sourcemeta::core::default_schema_walker ,
395+ schema, sourcemeta::core::schema_official_walker ,
396396 sourcemeta::core::official_resolver,
397397 " https://json-schema.org/draft/2020-12/schema" );
398398
0 commit comments