chell-hunit 0.1.0.1 → 0.2
raw patch · 2 files changed
+19/−25 lines, 2 filesdep −textdep ~basedep ~chellPVP ok
version bump matches the API change (PVP)
Dependencies removed: text
Dependency ranges changed: base, chell
API changes (from Hackage documentation)
- Test.Chell.HUnit: hunit :: Text -> Assertion -> Suite
+ Test.Chell.HUnit: hunit :: String -> Assertion -> Test
Files
- chell-hunit.cabal +7/−8
- lib/Test/Chell/HUnit.hs +12/−17
chell-hunit.cabal view
@@ -1,5 +1,5 @@ name: chell-hunit-version: 0.1.0.1+version: 0.2 license: MIT license-file: license.txt author: John Millikin <jmillikin@gmail.com>@@ -10,26 +10,25 @@ bug-reports: mailto:jmillikin@gmail.com homepage: https://john-millikin.com/software/chell/ -synopsis: HUnit support for Chell, a quiet test runner+synopsis: HUnit support for the Chell testing library source-repository head type: bazaar- location: https://john-millikin.com/software/chell/+ location: https://john-millikin.com/branches/chell-hunit/0.2/ source-repository this type: bazaar- location: https://john-millikin.com/software/chell/- tag: chell-hunit_0.1.0.1+ location: https://john-millikin.com/branches/chell-hunit/0.2/+ tag: chell-hunit_0.2 library hs-source-dirs: lib ghc-options: -Wall -O2 build-depends:- base >= 4 && < 5- , chell >= 0.1 && < 0.3+ base >= 4.0 && < 5.0+ , chell >= 0.3 && < 0.4 , HUnit >= 1.1 && < 1.3- , text exposed-modules: Test.Chell.HUnit
lib/Test/Chell/HUnit.hs view
@@ -2,33 +2,28 @@ ( hunit ) where -import Data.Text (Text, pack)- import qualified Test.Chell as Chell import Test.HUnit.Lang (Assertion, performTestCase) -- | Convert a sequence of HUnit assertions (embedded in IO) to a Chell--- 'Chell.Suite'.+-- 'Chell.Test'. -- -- @--- import Test.Chell--- import Test.Chell.HUnit--- import Test.HUnit+--import Test.Chell+--import Test.Chell.HUnit+--import Test.HUnit ----- tests :: [Suite]--- tests =--- [ suite \"foo\"--- [ hunit \"bar\" $ do--- 1 + 2 \@?= 3--- ]--- ]+--test_Addition :: Test+--test_addition = hunit \"addition\" $ do+-- 1 + 2 \@?= 3+-- 2 + 3 \@?= 5 -- @-hunit :: Text -> Assertion -> Chell.Suite-hunit name io = Chell.test (Chell.Test name chell_io) where+hunit :: String -> Assertion -> Chell.Test+hunit name io = Chell.test name chell_io where chell_io _ = do result <- performTestCase io return $ case result of Nothing -> Chell.TestPassed [] Just err -> parseError err- parseError (True, msg) = Chell.TestFailed [] [Chell.Failure Nothing (pack msg)]- parseError (False, msg) = Chell.TestAborted [] (pack msg)+ parseError (True, msg) = Chell.TestFailed [] [Chell.failure { Chell.failureMessage = msg }]+ parseError (False, msg) = Chell.TestAborted [] msg