4
4
module BDD where
5
5
6
6
import Control.Monad (ap )
7
- import Test.Framework (defaultMain , TestName , Test , testGroup )
8
- import Test.Framework.Providers.HUnit (testCase )
9
- import Test.HUnit (Assertion , (@?=) )
7
+ import Test.Tasty
8
+ import Test.Tasty.HUnit
10
9
11
10
#if !MIN_VERSION_base(4,8,0)
12
11
import Control.Applicative (Applicative (.. ))
@@ -24,13 +23,13 @@ import GHC.Stack (HasCallStack)
24
23
-------------------------------------------------------------------------------
25
24
26
25
specMain :: TestM () -> IO ()
27
- specMain t = runTestM t >>= defaultMain
26
+ specMain t = runTestM t >>= defaultMain . testGroup " specs "
28
27
29
- newtype TestM a = TestM { unTestM :: [Test ] -> IO ([Test ], a ) }
28
+ newtype TestM a = TestM { unTestM :: [TestTree ] -> IO ([TestTree ], a ) }
30
29
deriving (Functor )
31
30
32
31
-- accumulating in reverse order.
33
- tell1 :: Test -> TestM ()
32
+ tell1 :: TestTree -> TestM ()
34
33
tell1 t = TestM $ \ ts -> return (t : ts, () )
35
34
36
35
instance Applicative TestM where
@@ -44,7 +43,7 @@ instance Monad TestM where
44
43
(ys, x) <- unTestM m xs
45
44
unTestM (k x) ys
46
45
47
- runTestM :: TestM () -> IO [Test ]
46
+ runTestM :: TestM () -> IO [TestTree ]
48
47
runTestM (TestM m) = fmap (reverse . fst ) (m [] )
49
48
50
49
runIO :: IO a -> TestM a
0 commit comments