rust-claim icon indicating copy to clipboard operation
rust-claim copied to clipboard

Would it make sense to have assert_err_eq?

Open gyzerok opened this issue 3 years ago • 2 comments

Hello and thanks for a awesome crate! 🎉

While writing my tests and using claim I've started wondering whether there should be an assert_err_eq function. It feels like I don't only want to check if my result is an error, but that it is a specific error.

Any specific reason why such macro is missing?

gyzerok avatar Nov 26 '21 16:11 gyzerok

I've also wondered about this. Several times I've wanted to use something similar to assert_ok_eq to check that an Err contains an expected value.

Anders429 avatar Mar 15 '22 05:03 Anders429

FYI, this macro is now published in the fork @mattwilkinsonn put together: https://crates.io/crates/claims

Anders429 avatar Sep 01 '22 17:09 Anders429