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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ comline-codegen = { git = "https://github.com/ComlineProject/generation", rev =
# `comline-codegen`.
comline-doc-markdown = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" }
comline-doc-html = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "2d2c8853727929a7b350b3017c9ff86cb2ec8911", optional = true }
comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "c44b39d68035bd968cec0cd75afb6c6230c4ab76", optional = true }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "dd1c29e6560a0ffd7893c59715b31d43b88c585f", optional = true }
comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "d377fbf07cf6c0f004e9d5dd4fbd6fa15ea9d0bc", optional = true }
# `comline conformance`: the conformance runner (corpus loading, judging,
# profile proofs) and its case format, a public spec. Pinned by git rev.
comline-runtime-conformance = { git = "https://github.com/ComlineProject/runtime", rev = "8f8c0cb6fb0bc3a734aafbdbbf187fb9da73e00d" }
Expand Down
15 changes: 11 additions & 4 deletions tests/cli/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ fn config_idp_wire_format_reaches_the_rust_generator() {
.assert()
.success();

let chat = fs::read_to_string(project.join("generated/rust/chat.rs")).unwrap();
// The package's wire format is defined once, in `connection.rs`; the
// protocol files re-export it.
let connection = fs::read_to_string(project.join("generated/rust/connection.rs")).unwrap();
assert!(
chat.contains("pub type Format = comline_runtime::format::Json;"),
"{chat}"
connection.contains("pub type Format = comline_runtime::format::Json;"),
"{connection}"
);
}

Expand All @@ -256,8 +258,9 @@ fn without_a_wire_key_a_protocol_is_on_a_packed_connection() {
.success();

let chat = fs::read_to_string(project.join("generated/rust/chat.rs")).unwrap();
// `Format` is defined once, in `connection.rs`, and re-exported here.
assert!(
chat.contains("pub type Format = comline_runtime::format::Packed;"),
chat.contains("pub use crate::connection::{CONNECTION_IR_HASH, Format};"),
"{chat}"
);
assert!(
Expand All @@ -267,6 +270,10 @@ fn without_a_wire_key_a_protocol_is_on_a_packed_connection() {
assert!(!chat.contains("JsonRpcFraming"), "{chat}");
// The package's `Services` and `serve`, beside the schemas.
let connection = fs::read_to_string(project.join("generated/rust/connection.rs")).unwrap();
assert!(
connection.contains("pub type Format = comline_runtime::format::Packed;"),
"{connection}"
);
assert!(connection.contains("pub struct Services<"), "{connection}");
}

Expand Down
25 changes: 18 additions & 7 deletions tests/fixtures/generators/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tests/fixtures/generators/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ publish = false
[dependencies]
# The same revs the CLI pins, so the real generator's output is comparable
# byte for byte with the CLI's built-in one.
comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "05771e0679ff514da3ba73a3b0b94643e5262fe5" }
comline-doc-markdown = { git = "https://github.com/ComlineProject/generation", rev = "05771e0679ff514da3ba73a3b0b94643e5262fe5" }
comline-doc-html = { git = "https://github.com/ComlineProject/generation", rev = "05771e0679ff514da3ba73a3b0b94643e5262fe5" }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "df91e2e0a416cab594303f11d44a6555a72f891b" }
comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" }
comline-doc-markdown = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" }
comline-doc-html = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "dd1c29e6560a0ffd7893c59715b31d43b88c585f" }
Loading