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

Make it easier to use Hedgehog without Template Haskell #35

Merged
merged 1 commit into from Apr 10, 2017

Conversation

jacobstanley
Copy link
Member

@jacobstanley jacobstanley commented Apr 10, 2017

This adds a type Group which is a named collection of properties.

checkConcurrent and checkSequential are now regular functions which can execute the property tests in a Group. The Template Haskell property discovery is now just a single function discover which returns a Group.

Running tests with automatic discovery now looks like this:

tests :: IO Bool
tests =
  checkConcurrent $$(discover)

But now, if you prefer to avoid macros, you can specify the group of properties to run manually instead:

tests :: IO Bool
tests =
  checkConcurrent $ Group "Test.Example" [
      ("prop_reverse", prop_reverse)
    ]

@jacobstanley jacobstanley merged commit 07febb7 into master Apr 10, 2017
@jacobstanley jacobstanley deleted the topic/discovery branch April 10, 2017 22:39
--
checkWith :: RunnerConfig -> TExpQ (IO Bool)
checkWith config = do
discover :: TExpQ Group

Choose a reason for hiding this comment

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

💯 :)

@charleso
Copy link

Nice 👍

1 similar comment
@moodmosaic
Copy link
Member

Nice 👍

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.

None yet

3 participants