Assert! message best pratices?

⚓ Rust    📅 2025-04-25    👤 surdeus    👁️ 7      

surdeus

Warning

This post was published 118 days ago. The information described in this article may have changed.

Hi,

I am creating integration tests.
I realize that we can pass a message with assert! like this for example :

const MY_CUSTOM_ERROR :&str = "Error occurs when...";
assert!(false, "{}", MY_CUSTOM_ERROR);

But I wonder if you have eventually best pratices when using assert! message ?

Have a nice day !

3 posts - 2 participants

Read full topic

🏷️ rust_feed