-
Notifications
You must be signed in to change notification settings - Fork 107
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
Add classifications to properties #253
Add classifications to properties #253
Conversation
2c04184
to
07548d7
Compare
Tried a bunch of things to work around the bug in GHC 8.2.1. Couldn't get it unborken tonight. How important is 8.2.1 support? 8.2.2 works fine... |
Thanks for sending a pull request 👍 Consider adding a [WIP] on the title if it's not finalized (from what I can tell you keep adding commits). Also, considering squashing all those |
Lol, yes sorry - I wanted to fix the 8.2.1 issue before cleaning it up.
I'll add the WIP tag
…On Sun, 17 Mar 2019 at 20:35, Nikos Baxevanis ***@***.***> wrote:
Thanks for sending a pull request 👍 Consider adding a *[WIP]* on the
title if it's not finalized (from what I can tell you keep adding commits).
Also, considering squashing all those wat commits once you're done.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABdYwVk9GBvb7KhgnLVMV6rP7PxFLCT0ks5vXpjygaJpZM4b3-3G>
.
|
188470b
to
a1c79e5
Compare
@moodmosaic - I ended up figuring out which line was offending 8.2.1. I filter it out on 8.2.x series, maybe there's a more precise way to do this, but I can't figure one out. So tl;dr, ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this 👍 🚀 I left some high level feedback (and some nitpicks) though I haven't gotten into the implementation details yet. Let's wait for @jystic first.
@moodmosaic - I think I addressed your comments. If this patch is accepted, I'd like to continue work on the feature. Things I'd like to do:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for all the style nitpicks, I should really have a style guide. I didn't comment on all the abbreviations but you please find / fix them all. The codebase is pristine at the moment and I want to keep it that way. Generally this looks pretty good though, would love to have this feature!
Fwiw I'm happy to make the style fixups myself in another PR if you can't be bothered.
I'll amend the request in the morning (Stockholm)! Cheers for reviewing! |
8736454
to
c001c80
Compare
@jystic - good morning, that should be all of it. Hope I didn't miss anything 🙏 |
c001c80
to
59fc191
Compare
7dbd8f5
to
9e8723d
Compare
@jystic - rebased and ready for your verdict 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few items, would also like to make sure @HuwCampbell is happy enough with this before going ahead. I would like to align this with the approach taken in #262, but I don't think we need to hold this PR up because of that. All those changes wouldn't affect the public API so I don't mind if we do it over time.
classify :: (MonadTest m, HasCallStack) => Bool -> String -> m () | ||
classify = cover 0 | ||
|
||
cover :: (MonadTest m, HasCallStack) => Double -> Bool -> String -> m () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to have a comment for this as it will be visible in the haddock.
@mankyKitty maybe we should mention this in the style guide, public facing functions should have a comment. Internal ones I think it's developer's discretion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
9e8723d
to
59d79a6
Compare
@jystic - done 👍 |
Great, so I started adding a few newtypes around It also prints the current coverage while the test is running, you'll need to run the example to see. I moved the test to |
coverageFailures tests (Coverage kvs) = | ||
filter (not . classifierCovered tests) (Map.elems kvs) | ||
|
||
-- | Records the proportion of tests which satisfy a given condiiton. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condiiton
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! :D
@HuwCampbell I decided I will merge this and do the |
b1e21bf
to
1c08e08
Compare
1c08e08
to
451dc74
Compare
451dc74
to
d44f72a
Compare
Semigroup/Monoid 7.10 fun :) |
Issue 71: #71 Taken from a combination of the following PRs: - hedgehogqa/haskell-hedgehog#253 - hedgehogqa/haskell-hedgehog#262
Issue 71: #71 Taken from a combination of the following PRs: - hedgehogqa/haskell-hedgehog#253 - hedgehogqa/haskell-hedgehog#262
Issue 71: #71 Taken from a combination of the following PRs: - hedgehogqa/haskell-hedgehog#253 - hedgehogqa/haskell-hedgehog#262
Issue 71: #71 Taken from a combination of the following PRs: - hedgehogqa/haskell-hedgehog#253 - hedgehogqa/haskell-hedgehog#262
Issue 71: #71 Taken from a combination of the following PRs: - hedgehogqa/haskell-hedgehog#253 - hedgehogqa/haskell-hedgehog#262
Issue 71: #71 Taken from a combination of the following PRs: - hedgehogqa/haskell-hedgehog#253 - hedgehogqa/haskell-hedgehog#262
Issue 71: #71 Taken from a combination of the following PRs: - hedgehogqa/haskell-hedgehog#253 - hedgehogqa/haskell-hedgehog#262
Issue 71: #71 Taken from a combination of the following PRs: - hedgehogqa/haskell-hedgehog#253 - hedgehogqa/haskell-hedgehog#262
Map.singleton name (Classifier name mlocation minimum_ cover_) | ||
|
||
coverPercentage :: TestCount -> CoverCount -> CoverPercentage | ||
coverPercentage (TestCount tests) (CoverCount count) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixmulder, couldn't we just write this as
coverPercentage :: TestCount -> CoverCount -> CoverPercentage
coverPercentage (TestCount tests) (CoverCount count) =
CoverPercentage (fromIntegral count / fromIntegral tests * 100)
What thousandths
means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it does seem to me like that would be reasonable! I reckon this was done in order to get rid of decimals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to troubleshoot this, that was the reason I asked.
Was recommended this great talk by John Hughes on labelling properties, thought that would be cool to have in Hedgehog too.