File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ library
102
102
retry,
103
103
stm,
104
104
tar,
105
+ tasty,
105
106
tasty-discover,
106
107
tasty-hedgehog,
107
108
temporary,
Original file line number Diff line number Diff line change 11
11
12
12
module Hedgehog.Extras.Test.Unit
13
13
( UnitIO (.. )
14
+ , testUnitIO
14
15
) where
15
16
16
17
import Control.Monad.Base
@@ -30,6 +31,8 @@ import Lens.Micro
30
31
import Test.Tasty.Discover
31
32
import Test.Tasty.Hedgehog (testProperty )
32
33
34
+ import qualified Test.Tasty as T
35
+
33
36
newtype UnitIO a = UnitIO { runTestIO :: TestT (ResourceT IO ) a }
34
37
deriving newtype (Applicative )
35
38
deriving newtype (Functor )
@@ -45,5 +48,9 @@ newtype UnitIO a = UnitIO { runTestIO :: TestT (ResourceT IO) a }
45
48
deriving newtype (MonadThrow )
46
49
47
50
instance Tasty (UnitIO () ) where
48
- tasty info = pure . testProperty testName . H. withTests 1 . H. property . hoist runResourceT . H. test . runTestIO
51
+ tasty info = pure . testUnitIO testName
49
52
where testName = fromMaybe " " $ getLast (info ^. the @ " name" )
53
+
54
+ testUnitIO :: T. TestName -> UnitIO () -> T. TestTree
55
+ testUnitIO testName =
56
+ testProperty testName . H. withTests 1 . H. property . hoist runResourceT . H. test . runTestIO
You can’t perform that action at this time.
0 commit comments