-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We split hedgehog generators, and some tasty glue into its own library (as part of the Primer package). We split these out to enable reuse of generators between primer and primer-service in the future. Note that whilst internal libraries are supported with cabal-version: 2.4, the ability to set visibility is only available from 3.0. We regenerate hie.yaml via gen-hie, to make the haskell language server aware of this new library.
- Loading branch information
Showing
18 changed files
with
151 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module Tasty (Property, property, withTests, withDiscards) where | ||
|
||
import Data.Coerce (coerce) | ||
import Data.String (fromString) | ||
import Hedgehog qualified as H | ||
import Test.Tasty.Discover qualified as TD | ||
import Test.Tasty.Hedgehog qualified as TH | ||
|
||
import Foreword | ||
|
||
-- | Work around tasty changes which give deprecation warnings for tasty-discover generated code | ||
newtype Property = Property | ||
{ unProperty :: H.Property | ||
} | ||
|
||
instance TD.Tasty Property where | ||
tasty info = | ||
pure | ||
. TH.testPropertyNamed (TD.descriptionOf info) (fromString (TD.descriptionOf info)) | ||
. unProperty | ||
|
||
property :: HasCallStack => H.PropertyT IO () -> Property | ||
property = Property . H.property | ||
|
||
withTests :: H.TestLimit -> Property -> Property | ||
withTests = coerce H.withTests | ||
|
||
withDiscards :: H.DiscardLimit -> Property -> Property | ||
withDiscards = coerce H.withDiscards |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.