3 ms·
Shaving the yak: I find `$FNAME.test.odin` to be a bit nicer than `$FNAME_test.odin`. I'm confused about this caller_location thing in tests. It looks like you
by TheAceOfHearts 3y ago
Shaving the yak: I find `$FNAME.test.odin` to be a bit nicer than `$FNAME_test.odin`.
I'm confused about this caller_location thing in tests. It looks like you're just passing `loc = loc` a bunch of times for no good reason. Why can't the language automatically or implicitly implement that functionality? Having to write `loc = loc` at the end of every assertion just seems silly.
- skribanto 3y agoWithout it, it would pass the current location, that is the location inside that test function, rather than the original parent call.
- TheAceOfHearts 3y agoSure, I'm saying the language could aspire to implement full stack traces automatically for tests, rather than requiring passing it for all assertions. Having to keep writing the same thing over and over is just boilerplate and a distraction. There's no reason the language itself couldn't implement some built-in support for such functionality along with the testing module, given that they control the full ecosystem.