Test That! 0.5: A powerful test assertion library for Rust
โ Rust ๐ 2026-06-28 ๐ค surdeus ๐๏ธ 1Test That! lets you write test assertions which precisely specify your intent:
let vec = vec![5, 123, -4];
assert_that!(vec, each(gt(0)));
and get informative, meaningful diagnostics when the tests fail:
Value of: vec
Expected: only contains elements that is greater than 0
Actual: [5, 123, -4],
whose element #2 is -4, which is less than or equal to 0
I've recently published this new crate as a fork of GoogleTest Rust, which I had spearheaded a few years ago while I was at Google. Test That! has a much improved developer experience compared with the original. See my blog post (linked below) for more details.
I'm really keen on getting feedback on this crate. Please give it a try and let me know your experiences!
- Crate: crates.io: Rust Package Registry
- GitHub: GitHub - hovinen/test-that: Test assertion library for Rust based on the crate GoogleTest ยท GitHub
- Blog post announcement: Blog -- Bradford Hovinen
1 post - 1 participant
๐ท๏ธ Rust_feed