Permalink
Browse files

test framework.

  • Loading branch information...
1 parent e3a45b2 commit 97ecf24ba5921464dd8976116a91ba8d77743d1a @kazu-yamamoto committed Jun 3, 2010
Showing with 9 additions and 7 deletions.
  1. +9 −7 Test.hs
View
16 Test.hs
@@ -1,7 +1,9 @@
module Test where
-import Test.HUnit
import Command
+import Test.Framework (defaultMain, testGroup, Test, TestName)
+import Test.Framework.Providers.HUnit
+import Test.HUnit hiding (Test)
define :: IO ()
define = do
@@ -30,14 +32,14 @@ testSpec = [
, ("U", "Uxy", "(y((xx)y))")
]
-makeTest :: (String, String, String) -> Test
-makeTest (label, expr, ret) = (label ++ " combinator") ~: do
+makeTest :: (TestName, String, String) -> Test
+makeTest (label, expr, ret) = testCase label $ do
define
x <- eval' expr
x @?= ret
-tests :: Test
-tests = test $ map makeTest testSpec
+tests :: [Test]
+tests = [ testGroup "Combinator definition" (map makeTest testSpec)]
-main :: IO Counts
-main = runTestTT tests
+main :: IO ()
+main = defaultMain tests

0 comments on commit 97ecf24

Please sign in to comment.