These are chat archives for rust-lang/rust

21st
Oct 2018
Michael(LAI)
@Michael-Lfx
Oct 21 2018 01:00
@tanriol Thanks. Yeah, Context allocated in block2 is dropped when block2 is over.
tandrysyawaludin
@tandrysyawaludin
Oct 21 2018 07:57
what is the best http server for rust?
Victor Lopes
@vlopes11
Oct 21 2018 11:32
Colleagues, I'd like to build an agnostic test structure. My Rust application generates an executable who reads stdin and outputs stdout. I want to implement a non-rust test to send the stdin and expect the stdout (jsonrpc to be more precise). Any recommendations for testing frameworks for calling binaries like this?
Denis Lisov
@tanriol
Oct 21 2018 11:34
Why non-Rust?
Victor Lopes
@vlopes11
Oct 21 2018 11:34
Well, to be fully agnostic about the testing process. Could be Rust anyway, but i'd like to evaluate the alternatives
I could, for example, build a separate rust app to do this. But I'm testing not only Rust; also some communication with a Node service
But my question regards the actual frameworks we have available for standard stdio testing
The thing is. In future, I may need to perform an unit test also for one of these small node components. Who knows the future anyway?
Michal 'vorner' Vaner
@vorner
Oct 21 2018 13:19
@vlopes11 It's probably not exactly what you want, but a longish time ago, I was helping to organize some programming contests. And most of the time, people submitted code, it got compiled and then checked against expected inputs and outputs. It was pluggable, so it could scale from exact output, with some variance in the output (whitespace differences, lines in arbitrary order), to judge programs (ok/not-ok output) to things like interactive opponent games. We were using this for the whole stuff: https://www.ucw.cz/moe/, maybe you could use something from there.
Michal 'vorner' Vaner
@vorner
Oct 21 2018 13:51
Say I have a library with generic type struct X<T> and I add another type parameter with default value (struct X<T, U=()>), is that API compatible? Can I release it with semver-compat version bump only?
Victor Lopes
@vlopes11
Oct 21 2018 16:07
Thanks man! I’ll take a look :)
Daniel Bischof
@dbischof90
Oct 21 2018 16:08
I'm trying out capnp right now
considering I received x = Vec<u8> and have a schema Scheme that I can encode/decode bytes into, is there a nice way (it would be optimal to yield a Result<T,E>) to check whether x can be decoded with Scheme without panicking?
Or would I simply try to read and an Error during that process is to be interpreted as 'not decoded by this scheme'?
Daniel Bischof
@dbischof90
Oct 21 2018 16:26
Ah got it
By providing a schema-specific get_root you produce a result.