[#259] Fix error location in hedgehog tests
Description
Problem: If the property test in Cleveland fails, the
error location is shown incorrectly (instead of directly
the place of the error, the nettestTestProp
function is
always highlighted). We'd like to highlight the line in
the scenario that led to the error.
Solution: created Cleveland.Test.Internal.Hedgehog
module
which contains reworked versions of some of the internal functions
from Hedgehog
library. Now nettestTestProp
uses evalIO
function
from the new module, which, when the test fails, retrieves callstack
from WithCallStack
exception and highlights its last frame.
Related issue(s)
Resolves #259 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.
Edited by Dmitriy Mozhevitin