-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
31 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1 @@ | ||
module Main where | ||
|
||
import Effectful.Zoo.Hedgehog.Api.Tasty | ||
import Effectful.Zoo.Hedgehog.Test.PropertySpec | ||
import Test.Tasty (TestTree, defaultMain, testGroup) | ||
import HaskellWorks.Prelude | ||
|
||
tests :: TestTree | ||
tests = | ||
testGroup "all" | ||
[ toTestTree "Simple property spec" property_spec | ||
, toTestTree "Simple test spec" test_spec | ||
] | ||
|
||
main :: IO () | ||
main = | ||
defaultMain tests | ||
{-# OPTIONS_GHC -F -pgmF tasty-discover #-} |
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
18 changes: 18 additions & 0 deletions
18
components/hedgehog/Effectful/Zoo/Hedgehog/Api/Tasty/Orphans.hs
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,18 @@ | ||
{-# OPTIONS_GHC -fno-warn-orphans #-} | ||
|
||
module Effectful.Zoo.Hedgehog.Api.Tasty.Orphans where | ||
|
||
import Data.Monoid | ||
import HaskellWorks.Prelude | ||
import Hedgehog (PropertyT, TestT) | ||
import Hedgehog qualified as H | ||
import Test.Tasty.Discover | ||
import Test.Tasty.Discover.TastyInfo | ||
import Test.Tasty.Hedgehog | ||
|
||
instance Tasty (PropertyT IO ()) where | ||
tasty info = pure . testProperty testName . H.property | ||
where testName = fromMaybe "" $ getLast info.name | ||
|
||
instance Tasty (TestT IO ()) where | ||
tasty info = tasty info . H.test |
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