A variant of @test that allows attaching description to fails
fjarri opened this issue · 1 comments
Currently, if a @test
fails, the only information that is shown in the report is the value of the parts of the expression (generated automatically). Sometimes it is not enough. For example, if one compares two large matrices, it may be useful to show which elements are not equal without printing the whole matrix. Another example is match_text()
in test/TestUtils
which currently has to report the fail description (namely, the exact line where the template differs from the given text) via error()
, which means that the failure is reported as an error.
It would be therefore useful to have a mechanism that would allow to show a custom fail description in the report. One variant would be a new macro that catches FailureDescription
exceptions, and passing others through as errors.
When it is in place, match_text()
can actually be added to the main library.