packages feed

chell-hunit 0.2.1 → 0.3

raw patch · 4 files changed

+60/−45 lines, 4 filesdep ~HUnitdep ~chellnew-uploaderPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: HUnit, chell

API changes (from Hackage documentation)

Files

+ Test/Chell/HUnit.hs view
@@ -0,0 +1,32 @@+module Test.Chell.HUnit+  ( hunit+  ) where++import qualified Test.Chell as Chell+import           Test.HUnit.Lang (Assertion, Result (..), performTestCase)++-- | Convert a sequence of HUnit assertions (embedded in IO) to a Chell+-- 'Chell.Test'.+--+-- @+--import Test.Chell+--import Test.Chell.HUnit+--import Test.HUnit+--+--test_Addition :: Test+--test_addition = hunit \"addition\" $ do+--    1 + 2 \@?= 3+--    2 + 3 \@?= 5+-- @+hunit :: String -> Assertion -> Chell.Test+hunit name io = Chell.test name chell_io+  where+    chell_io _ =+      do+        result <- performTestCase io+        return $+            case result of+                Success -> Chell.TestPassed []+                Failure _ msg -> Chell.TestFailed []+                    [Chell.failure { Chell.failureMessage = msg }]+                Error _ msg -> Chell.TestAborted [] msg
+ changelog.md view
@@ -0,0 +1,8 @@+# Release history for `chell-hunit`++0.3 - 2019 Feb 16++  * Add support for `HUnit` 1.3 through 1.6+  * Drop support for `HUnit` 1.1 through 1.2++0.2.1 - 2014 May 18
chell-hunit.cabal view
@@ -1,34 +1,38 @@ name: chell-hunit-version: 0.2.1+version: 0.3++synopsis: HUnit support for the Chell testing library+category: Testing+ license: MIT license-file: license.txt author: John Millikin <john@john-millikin.com>-maintainer: John Millikin <john@john-millikin.com>+maintainer: Chris Martin, Julie Moronuki build-type: Simple cabal-version: >= 1.6-category: Testing-bug-reports: mailto:jmillikin@gmail.com-homepage: https://john-millikin.com/software/chell/ -synopsis: HUnit support for the Chell testing library+homepage:    https://github.com/typeclasses/chell+bug-reports: https://github.com/typeclasses/chell/issues -source-repository head-  type: git-  location: https://john-millikin.com/code/chell-hunit/+description:+  HUnit support for the <https://hackage.haskell.org/package/chell Chell> testing library. -source-repository this+tested-with: GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.3++extra-source-files:+  changelog.md++source-repository head   type: git-  location: https://john-millikin.com/code/chell-hunit/-  tag: chell-hunit_0.2.1+  location: https://github.com/typeclasses/chell.git  library-  hs-source-dirs: lib-  ghc-options: -Wall -O2+  ghc-options: -Wall    build-depends:       base >= 4.0 && < 5.0-    , chell >= 0.3 && < 0.5-    , HUnit >= 1.1 && < 1.3+    , chell >= 0.3 && < 0.6+    , HUnit >= 1.3 && < 1.7    exposed-modules:     Test.Chell.HUnit
− lib/Test/Chell/HUnit.hs
@@ -1,29 +0,0 @@-module Test.Chell.HUnit-	( hunit-	) where--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.Test'.------ @---import Test.Chell---import Test.Chell.HUnit---import Test.HUnit------test_Addition :: Test---test_addition = hunit \"addition\" $ do---    1 + 2 \@?= 3---    2 + 3 \@?= 5--- @-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 { Chell.failureMessage = msg }]-	parseError (False, msg) = Chell.TestAborted [] msg