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
2 changes: 1 addition & 1 deletion codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"
# Interim: track `core` by git rev (see design/runtime-repo-structure.md — no
# crates.io publishing at this stage). Local iteration: uncomment the
# workspace-root [patch] onto a sibling checkout.
comline-core = { git = "https://github.com/ComlineProject/core", rev = "aa84d970d3295df59cc3e620bdb71bf96382f97b" }
comline-core = { git = "https://github.com/ComlineProject/core", rev = "47ac5f10a36b587d14d1b9672fba65d8f3712962" }

eyre = "0.6.8"
6 changes: 3 additions & 3 deletions conformance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ publish = false
# to their own repos. See design/runtime-repo-structure.md (rollout step 3).

[dependencies]
comline-core = { git = "https://github.com/ComlineProject/core", rev = "aa84d970d3295df59cc3e620bdb71bf96382f97b" }
comline-core = { git = "https://github.com/ComlineProject/core", rev = "47ac5f10a36b587d14d1b9672fba65d8f3712962" }

[dev-dependencies]
comline-codegen = { path = "../codegen" }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "070c77759b77f3f9a51ae217734277c95414f71f" }
comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "97d8b2ea3db8b0489eaa8a1ad1fa2e89cfb391e6" }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "a70cafcdd2015686ff1dbfba59b2b56ff70b730d" }
comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "7f2ddd3ed97c412389e0a0bf06420774b1a659d3" }
56 changes: 37 additions & 19 deletions conformance/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,34 @@ fn function(
name: &str,
args: Vec<FrozenArgument>,
ret: Option<&str>,
throws: Vec<&str>,
throws: Vec<u16>,
) -> FrozenUnit {
FrozenUnit::Function {
docstring: String::new(),
parameters: vec![],
name: name.to_string(),
synchronous: true,
arguments: args,
_return: ret.map(|t| KindValue::Namespaced(t.to_string(), None)),
throws: throws.into_iter().map(String::from).collect(),
throws,
span: (0, 0),
}
}

/// A local `error`, ordinal assigned by the fixture itself (mirroring what
/// `plan_error_space` would freeze from a real schema — see
/// `core::schema::ir::compiler::interpreter::incremental`).
fn error(ordinal: u16, name: &str) -> FrozenUnit {
FrozenUnit::Error {
docstring: None,
parameters: vec![],
ordinal,
imported_from: None,
name: name.to_string(),
message: format!("{name} occurred"),
fields: vec![],
}
}

// ── fixtures ────────────────────────────────────────────────────────────────

fn primitives() -> Fixture {
Expand Down Expand Up @@ -153,22 +168,25 @@ fn protocol() -> Fixture {
Fixture {
name: "protocol",
namespace: "conformance",
units: vec![FrozenUnit::Protocol {
docstring: "Conformance protocol".to_string(),
parameters: vec![],
name: "Service".to_string(),
functions: vec![
function(
"lookup",
vec![arg("id", Primitive::S32(None))],
Some("Record"),
vec!["NotFound"],
),
function("count", vec![], Some("u64"), vec![]),
function("notify", vec![arg("code", Primitive::U16(None))], None, vec![]),
],
span: (0, 0),
}],
units: vec![
error(0, "NotFound"),
FrozenUnit::Protocol {
docstring: "Conformance protocol".to_string(),
parameters: vec![],
name: "Service".to_string(),
functions: vec![
function(
"lookup",
vec![arg("id", Primitive::S32(None))],
Some("Record"),
vec![0], // ordinal of `NotFound`, above
),
function("count", vec![], Some("u64"), vec![]),
function("notify", vec![arg("code", Primitive::U16(None))], None, vec![]),
],
span: (0, 0),
},
],
}
}

Expand Down
Loading