tasty-th 0.1.1 → 0.1.2
raw patch · 3 files changed
+18/−17 lines, 3 files
Files
- BSD3.txt +1/−0
- src/Test/Tasty/TH.hs +14/−14
- tasty-th.cabal +3/−3
BSD3.txt view
@@ -1,4 +1,5 @@ Copyright (c) 2010, Oscar Finnsson+Copyright (c) 2013-2014, Benno Fünfstück All rights reserved. Redistribution and use in source and binary forms, with or without
src/Test/Tasty/TH.hs view
@@ -1,30 +1,30 @@ ----------------------------------------------------------------------------- ----- Module : MainTestGenerator--- Copyright : --- License : BSD4+-- Module : Test.Tasty.TH+-- Copyright : Oscar Finnsson, Benno Fünfstück+-- License : BSD3 -- -- Maintainer : Benno Fünfstück--- Stability : --- Portability : +-- Stability :+-- Portability : ----- +-- ------------------------------------------------------------------------------{-# OPTIONS_GHC -XTemplateHaskell #-}+{-# LANGUAGE TemplateHaskell #-} -module Test.Tasty.TH +module Test.Tasty.TH ( testGroupGenerator , defaultMainGenerator ) where import Language.Haskell.TH-import Language.Haskell.Extract +import Language.Haskell.Extract import Test.Tasty -- | Generate the usual code and extract the usual functions needed in order to run HUnit/Quickcheck/Quickcheck2. -- All functions beginning with case_, prop_ or test_ will be extracted.--- +-- -- > {-# OPTIONS_GHC -fglasgow-exts -XTemplateHaskell #-} -- > module MyModuleTest where -- > import Test.HUnit@@ -43,7 +43,7 @@ -- > [ testCase "1" case_Foo -- > , testProperty "2" prop_Reverse -- > ]--- +-- -- will automagically extract prop_Reverse, case_Foo, case_Bar and test_Group and run them as well as present them as belonging to the testGroup 'MyModuleTest' such as -- -- > me: runghc MyModuleTest.hs@@ -65,7 +65,7 @@ -- | Generate the usual code and extract the usual functions needed for a testGroup in HUnit/Quickcheck/Quickcheck2. -- All functions beginning with case_, prop_ or test_ will be extracted.--- +-- -- > -- file SomeModule.hs -- > fooTestGroup = $(testGroupGenerator) -- > main = defaultMain [fooTestGroup]@@ -73,7 +73,7 @@ -- > case_2 = do 2 @=? 2 -- > prop_p xs = reverse (reverse xs) == xs -- > where types = xs :: [Int]--- +-- -- is the same as -- -- > -- file SomeModule.hs@@ -105,7 +105,7 @@ applyNameFix :: String -> ExpQ applyNameFix n = do fn <- [|fixName|]- return $ LamE [VarP (mkName "n")] (AppE (VarE (mkName n)) (AppE (fn) (VarE (mkName "n"))))+ return $ LamE [VarP (mkName "n")] (AppE (VarE (mkName n)) (AppE fn (VarE (mkName "n")))) fixName :: String -> String fixName name = replace '_' ' ' $ drop 5 name
tasty-th.cabal view
@@ -1,10 +1,10 @@ name: tasty-th-version: 0.1.1+version: 0.1.2 cabal-version: >= 1.6 build-type: Simple license: BSD3 license-file: BSD3.txt-maintainer: Benno Fünfstück+maintainer: Benno Fünfstück <benno.fuenfstueck@gmail.com> homepage: http://github.com/bennofs/tasty-th synopsis: Automagically generate the HUnit- and Quickcheck-bulk-code using Template Haskell. description: A fork of of test-framework-th modified to use tasty instead of test-framework.@@ -13,7 +13,7 @@ author: Oscar Finnsson & Emil Nordling & Benno Fünfstück library- exposed-modules: Test.Tasty.TH + exposed-modules: Test.Tasty.TH build-depends: base >= 4 && < 5, tasty, language-haskell-extract >= 0.2, template-haskell hs-source-dirs: src