Skip to content

Unit testing seems to be difficult #27

@steveej

Description

@steveej

I've just gotten started using this crate and I'm struggling with something rather simple.
Here's a snippet of my code, which is supposed to build a greeting message:

impl Server for Proxy {
    fn hello(&mut self,
            params: HelloParams<>,
            mut results: HelloResults<>)
            -> ::capnp::capability::Promise<(), ::capnp::Error> {

        results
            .get()
            .set_greetings(&format!("Hello {}", pry!(params.get()).get_name().unwrap()));
        ::capnp::capability::Promise::ok(())
    }
}

I would like to write a unit test for this, but no matter which approach I try it seems too difficult to immitate capnp's internals. I'd be happy about any pointers on how to approach this, or if someone could point out any mistakes I've already made ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions