3 ms·
I like Rust unit tests, simply because you don't need to set anything up to use them. Also they can go in the module you're testing, so writing tests for things
by wtetzner 3y ago
I like Rust unit tests, simply because you don't need to set anything up to use them. Also they can go in the module you're testing, so writing tests for things that are not public is simple.
- TrustPatches 3y ago+1, being able to write tests that access private fields and functions means you never need to expose behavior or data purely for testability
- sshine 3y agoI do like how Rust’s test system ships with Cargo and how tests are local to a private submodule. I wish the test report output was more comprehensible, and that there was a property test framework that felt more like in Haskell, e.g printing the PRNG seed when a test fails and letting you run with that seed again; it seems like proptest is the best there is, and it’s doing its own thing, kind of like how property tests work in OCaml.
- wtetzner 3y agoYeah, it would be nice if you could easily hook into the test runner/reporting stuff.