Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
lungdart3428318dWhat language?
When I use assertions in pytest (Python) and they fail, it tells me what each value in the condition was derived from. -
lorentz15191318d@lungdart Rust. I definitely would've appreciated just then if assert macros printed their input alongside the error.
-
lungdart3428318dhttps://doc.rust-lang.org/std/...
Looks like you can do it by passing a string to the format parameter. It might be more verbose, but I'm sure you could wrap it if it's a frequently used pattern -
lorentz15191318d@lungdart I use the message a lot, I just don't tend to repeat the values in it unless I'm debugging a specific assert.
-
lungdart3428318d@lorentz speaking of a debugger, can you use one? If you get inspection at the assert, you can trace it back much faster then printing meta data, compiling, Ave rerunning
-
lorentz15191318d@lungdart I used to use them a lot but I kinda stopped because trying to persist the probe through event-driven JavaScript was more difficult than it was helpful. I guess I should re-learn them.
Related Rants
-
chtorr9720I'm the git master in my group for a uni project as I am the only one with some experience. This is what I ha...
-
Dacexi24When there are only 2 pages on Google you know you're in serious shit.
-
practiseSafeHex20Fixing a parents iPhone, episode 1. Problem: "Whatsapp is gone off my phone" Debugging: Me: *unlocks phone...
Debugging an assertion for hours that keeps failing on 19 == 20 , and you just cannot figure out why it returns 20, until you realize that it in fact returns 19 and the constant in the test case that you screwed up at the start reads 20.
rant
pain
debugging