Is it possible to expect a crash?
Crashes are not really meant to ever happen, so it might be odd to expect a crash, but there are some scenarios where this is desirable: for example, I'm working on an exercise on exercism.org to teach error handling. One of the scenarios involves getting the user to write a function that crashes with a "To-Do" message. I don't know how to test that right now.
It is not
At least not without a custom test platform for exercism
Actually, now that I think about it, tests run on a custom platform built into the compiler, so we could technically make it support expect-crash
, but it would be a special keyword and larger project
personally I think I'd just explain what it is and not make a test for it
people will understand :big_smile:
personally I think I'd just explain what it is and not make a test for it
Yeah, probably for the best.
Sounds good, thanks for your feedback
Last updated: Jul 06 2025 at 12:14 UTC