mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
261 stars 30 forks source link

Idea: Specifying additional context when reporting assert collection #188

Open LudvigOlsen opened 4 years ago

LudvigOlsen commented 4 years ago

I'm wondering, if it would be useful to add a context argument to the assert collection (e.g. on initialization or when calling reportAssertions()), or in the assert functions themselves. It could be used to to clarify that an assertion is only required to pass in certain contexts, e.g. if some flag is TRUE.

When I have a sub function that is only used when x is TRUE in a parent function, it would be useful to add that scope information to all asserts in that function.