tasty-hunit-0.4.1/0000755000000000000000000000000012241734416012177 5ustar0000000000000000tasty-hunit-0.4.1/LICENSE0000644000000000000000000000204312241734416013203 0ustar0000000000000000Copyright (c) 2013 Roman Cheplyaka Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. tasty-hunit-0.4.1/tasty-hunit.cabal0000644000000000000000000000147612241734416015464 0ustar0000000000000000-- Initial tasty-hunit.cabal generated by cabal init. For further -- documentation, see http://haskell.org/cabal/users-guide/ name: tasty-hunit version: 0.4.1 synopsis: HUnit support for the Tasty test framework. description: HUnit support for the Tasty test framework. license: MIT license-file: LICENSE author: Roman Cheplyaka maintainer: roma@ro-che.info -- copyright: category: Testing build-type: Simple -- extra-source-files: cabal-version: >=1.10 library exposed-modules: Test.Tasty.HUnit -- other-modules: other-extensions: TypeFamilies, DeriveDataTypeable build-depends: base ==4.*, tasty, HUnit, mtl -- hs-source-dirs: default-language: Haskell2010 tasty-hunit-0.4.1/Setup.hs0000644000000000000000000000005612241734416013634 0ustar0000000000000000import Distribution.Simple main = defaultMain tasty-hunit-0.4.1/Test/0000755000000000000000000000000012241734416013116 5ustar0000000000000000tasty-hunit-0.4.1/Test/Tasty/0000755000000000000000000000000012241734416014222 5ustar0000000000000000tasty-hunit-0.4.1/Test/Tasty/HUnit.hs0000644000000000000000000000242512241734416015610 0ustar0000000000000000-- | This module allows to use HUnit tests in tasty. {-# LANGUAGE TypeFamilies, DeriveDataTypeable #-} module Test.Tasty.HUnit ( testCase -- | We only re-export parts of "Test.HUnit.Base" related to assertions -- and not tests. , module Test.HUnit.Base ) where import Test.Tasty.Providers import qualified Test.HUnit.Base import Test.HUnit.Lang import Test.HUnit.Base hiding -- for re-export ( Test(..) , Testable(..) , (~=?) , (~?=) , (~:) , (~?) , State(..) , Counts(..) , Path , Node , testCasePaths , testCaseCount , ReportStart , ReportProblem , performTest ) import Data.Typeable import Control.Monad.Trans -- | Create a 'Test' for a HUnit 'Assertion' testCase :: TestName -> Assertion -> TestTree testCase name = singleTest name . TestCase newtype TestCase = TestCase Assertion deriving Typeable instance IsTest TestCase where run _ (TestCase assertion) _ = do hunitResult <- performTestCase assertion return $ case hunitResult of Nothing -> Result { resultSuccessful = True , resultDescription = "" } Just (_, message) -> Result { resultSuccessful = False , resultDescription = message } testOptions = return []