In my opinion, the most important quality for any test failure message to have is that it should give enough information for the reader to understand what the test failure means without having to modify the test, attach a debugger, or (ideally) even read the test code in detail. (This is so that, if a change causes multiple test failures, the developer can scan the failures to gain an understanding of what they broke when they weren’t expecting to break anything.)
Given that principle, the best message depends entirely on what the assertion is actually asserting. (And an assert_eq! may not need any custom message, if the test name and the values printed make things clear enough.)
I don’t see what benefit you gain from declaring a const here.
The const is because I can have a lot of assert in my tests with the same message...
Thank you for your answer.
I try to give the explicit reasons while the assert fails with the expected value at the moment.
I compare response and data expected...