Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include location of failed assertion in report #308

Merged
merged 2 commits into from
Jun 21, 2019

Conversation

owickstrom
Copy link
Contributor

Fixes #306.

Adds the location of the failed assertion (taken from the Span value of the failure report). Example output:

 ✗ <interactive> failed at test/Test/Hedgehog/Applicative.hs:91:11
    after 1 test.

       ┏━━ test/Test/Hedgehog/Applicative.hs ━━━
    69 ┃ ...

This enables editors to more easily parse the location of failed test assertions, and provide links/jump functionality. This has been tested with Emacs.

Fixes hedgehogqa#306.

Adds the location of the failed assertion (taken from the Span value
of the failure report). Example output:

```
 ✗ <interactive> failed at test/Test/Hedgehog/Applicative.hs:91:11
    after 1 test.

       ┏━━ test/Test/Hedgehog/Applicative.hs ━━━
    69 ┃ ...

```

This enables editors to easily parse the location of failed test
assertions and provide links/jump functionality.
Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍 👍

@jacobstanley
Copy link
Member

Looking great! 🎉

I'm surprised this prints like this (extra space shown as _):

 ✗ <interactive> failed at test/Test/Hedgehog/Applicative.hs:91:11
   _after 1 test.

The code looks like that shouldn't be the case, just copy/paste error?

@owickstrom
Copy link
Contributor Author

Hmm, that is strange. I know the (<#>) operator is supposed to be replaced with a space when using another operation called group, but in this case that shouldn't happen. I'll try with (<##>) instead and see how that prints.

@owickstrom
Copy link
Contributor Author

@jacobstanley OK the indent thing was likely a copy-paste error. Confirmed it's correctly indented in GHCi and in regular test runs through cabal v2-test.

Copy link
Member

@jacobstanley jacobstanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🇸🇪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include file/line/column of failed assertion in output?
3 participants