Introducing Test That!: A powerful test assertion library for Rust
Test 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: https://crates.io/crates/test-that
- GitHub: https://github.com/hovinen/test-that
- Blog post announcement: https://hovinen.me/announcements/2026/06/24/introducing-test-that.html