Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ir/ir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ auto compile(const sourcemeta::core::JSON &input,
sourcemeta::core::SchemaTransformer canonicalizer;
sourcemeta::core::add(canonicalizer,
sourcemeta::core::AlterSchemaMode::Canonicalizer);
[[maybe_unused]] const auto canonicalized{
canonicalizer.apply(schema, walker, resolver,
[](const auto &, const auto, const auto,
const auto &) { assert(false); })};
[[maybe_unused]] const auto canonicalized{canonicalizer.apply(
schema, walker, resolver,
[](const auto &, const auto, const auto, const auto &) { assert(false); },
default_dialect, default_id)};
assert(canonicalized.first);

// --------------------------------------------------------------------------
Expand Down
18 changes: 18 additions & 0 deletions test/ir/ir_2020_12_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ TEST(IR_2020_12, test_1) {
EXPECT_SYMBOL(std::get<IRScalar>(result.at(0)).symbol);
}

TEST(IR_2020_12, default_dialect_parameter) {
const sourcemeta::core::JSON schema{sourcemeta::core::parse_json(R"JSON({
"type": "string"
})JSON")};

const auto result{sourcemeta::codegen::compile(
schema, sourcemeta::core::schema_walker,
sourcemeta::core::schema_resolver, sourcemeta::codegen::default_compiler,
"https://json-schema.org/draft/2020-12/schema")};

using namespace sourcemeta::codegen;

EXPECT_EQ(result.size(), 1);

EXPECT_IR_SCALAR(result, 0, String, "");
EXPECT_SYMBOL(std::get<IRScalar>(result.at(0)).symbol);
}

TEST(IR_2020_12, test_2) {
const sourcemeta::core::JSON schema{sourcemeta::core::parse_json(R"JSON({
"$schema": "https://json-schema.org/draft/2020-12/schema",
Expand Down