Skip to content

Conversation

avh4
Copy link
Contributor

@avh4 avh4 commented May 1, 2022

Run tests with cabal test -f dev.

This approach uses the "common" stanzas feature of cabal to add the source files of the exe to the test-suite module. This means that if you build and then test, the changed files will get compiled twice (once for exe, and one for tests), but imo this way is better than the alternative, which requires that you put all your hs files into a lib module where all files are publicly exposed, and have exe and tests both depend on lib.

@avh4 avh4 requested a review from robinheghan May 1, 2022 07:17
Copy link
Member

@robinheghan robinheghan left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment on lines +4 to +6
- build: `cabal build -f dev`
- run tests: `cabal test -f dev`
- format files: `find -name '*.hs' | xargs -t ormolu -m inplace`
Copy link
Member

Choose a reason for hiding this comment

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

💯

@avh4 avh4 merged commit 0ef8831 into main May 1, 2022
@avh4 avh4 deleted the hspec branch May 1, 2022 08:06
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.

2 participants