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

Fix "insufficient coverage" message #521

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion hedgehog/src/Hedgehog/Internal/Property.hs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ newtype TestLimit =
--
newtype TestCount =
TestCount Int
deriving (Eq, Ord, Show, Num, Enum, Real, Integral, Lift)
deriving (Eq, Ord, Num, Enum, Real, Integral, Lift)

instance Show TestCount where
showsPrec p (TestCount n) =
showsPrec p n
Copy link
Contributor Author

@sol sol May 3, 2024

Choose a reason for hiding this comment

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

  1. We probably would want this for the other newtypes around Int as well.
  2. Are ok with dropping support for GHC 8.0.*? If yes, I can simplify this to:
      deriving Lift
      deriving newtype (Eq, Ord, Show, Num, Enum, Real, Integral)

Copy link
Member

Choose a reason for hiding this comment

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

Good catch on Show 👍

How about planning for a release this month, and after doing the release drop support for GHC 8.0.*?

Copy link
Contributor Author

@sol sol May 3, 2024

Choose a reason for hiding this comment

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

Regarding GHC 8.0.*, anything works for me. If we are not ready to drop support now, then I guess we want that code as this. So from my perspective, this is ready to merge.

Regarding Show instances of other newtype wraps, we might still want to add the manual instances or wait for after the release. Again, both works for me, but if now, I would do it as a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps, the best would be to merge this as-is, add Show instances of other newtypes as separate PRs if needed, and drop GHC 8.0.* after this release. If you agree, I think we can merge this as-is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, sounds great 👍


-- | The number of tests a property had to discard.
--
Expand Down
2 changes: 1 addition & 1 deletion hedgehog/src/Hedgehog/Internal/Runner.hs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ checkReport cfg size0 seed0 test0 updateUI = do
successReport
else
failureReport $
"Labels not sufficently covered after " <> show tests <> " tests"
"Labels not sufficiently covered after " <> show tests <> " tests"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

before: Labels not sufficently covered after TestCount 100 tests
after:  Labels not sufficiently covered after 100 tests

Copy link
Member

Choose a reason for hiding this comment

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

Good catch 👍


else if discards >= fromIntegral (propertyDiscardLimit cfg) then
-- we've hit the discard limit, give up
Expand Down
Loading