Skip to content

[#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

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Dmitriy Mozhevitin

Merge request reports