Skip to content

test: end-to-end Dispatch round-trip + Kind::resolve (rollout step 7c) - #3

Merged
Kinflou merged 1 commit into
mainfrom
feat/runtime-dispatch-roundtrip
Sep 1, 2026
Merged

test: end-to-end Dispatch round-trip + Kind::resolve (rollout step 7c)#3
Kinflou merged 1 commit into
mainfrom
feat/runtime-dispatch-roundtrip

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 1, 2026

Copy link
Copy Markdown
Member

Follows #2.

  • Kind::resolve(&[&str]) -> Option<usize> — a function's position in its protocol's calls_names(), from Id (direct) or Named (lookup). A generated dispatcher maps NoneRuntimeError::UnknownCall. Unit-tested.
  • tests/dispatch_roundtrip.rs — a hand-written stand-in for what comline-rust will emit: an Echo protocol with a client stub + a Dispatch impl, driven directly with MsgPack, no network. Proves the whole contract surface (Kind, WireFormat, Dispatch, Envelope, BufMut, CallError) fits together:
    • ok path round-trips,
    • a raised ! TooLong is reconstructed typed on the client from the Envelope ordinal (CallError::App(SayError::TooLong(..))),
    • an out-of-range KindRuntimeError::UnknownCall.
  • Guard tests/mod.rs's setups (the std-only setup/ layer) behind feature = "std"cargo test --no-default-features now compiles.

Verified

All feature configs green: cargo test (9 lib + 3 round-trip + 1 ignored), --no-default-features (2), --features alloc (5).

Next (7d)

Start reworking the stubbed setup/ — a real CallSystem that carries a Dispatch and a WireFormat, over the in-memory transport first, then TCP.

Kind::resolve(&[&str]) -> Option<usize>: a function's position in
calls_names(), from Id (direct) or Named (lookup); a dispatcher maps None
to RuntimeError::UnknownCall. Unit tests included.

tests/dispatch_roundtrip.rs: a hand-written stand-in for comline-rust's
output -- an Echo protocol with a client stub and a Dispatch impl, driven
directly with MsgPack. Proves the whole contract surface fits together:
the ok path, a raised typed error reconstructed client-side via the
Envelope ordinal, and an out-of-range Kind -> UnknownCall.

Also guard tests/mod.rs's setups module (the std-only setup/ layer) behind
feature = "std" so cargo test --no-default-features compiles. All feature
configs are green.
@Kinflou
Kinflou force-pushed the feat/runtime-dispatch-roundtrip branch from b831892 to a56aa9f Compare September 1, 2026 14:21
@Kinflou
Kinflou merged commit 1d45fc2 into main Sep 1, 2026
6 checks passed
@Kinflou
Kinflou deleted the feat/runtime-dispatch-roundtrip branch September 2, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant