tasty-hunit 0.10.0.2 → 0.10.2
raw patch · 4 files changed
Files
- CHANGELOG.md +28/−0
- Test/Tasty/HUnit/Orig.hs +7/−6
- Test/Tasty/HUnit/Steps.hs +8/−5
- tasty-hunit.cabal +7/−8
CHANGELOG.md view
@@ -1,6 +1,34 @@ Changes ======= +Version 0.10.2+--------------++* Teach `testCaseSteps` to log progress+ ([#387](https://github.com/UnkindPartition/tasty/pull/387)).++Version 0.10.1+---------------++* Provide an explicit implementation of `displayException`+ in `instance Exception HUnitFailure`+ ([#330](https://github.com/UnkindPartition/tasty/issues/330)).++Version 0.10.0.3+----------------++The only point of this release is to introduce compatibility with GHCs back to 7.0+(see https://github.com/UnkindPartition/tasty/pull/287).++Note, however, that these changes are not merged to the master branch, and the+future releases will only support the GHC/base versions from the last 5 years,+as per our usual policy. To test with even older GHCs, you'll have to use this+particular version of tasty-hunit (or have the constraint solver pick it for you+when testing with older GHCs).++The source of this release is in the `support-old-ghcs` branch of the tasty+repository.+ Version 0.10.0.2 ----------------
Test/Tasty/HUnit/Orig.hs view
@@ -76,7 +76,7 @@ infix 1 @?, @=?, @?= -- | Asserts that the specified actual value is equal to the expected value--- (with the expected value on the left-hand side).+-- (with the /expected/ value on the left-hand side). (@=?) :: (Eq a, Show a, HasCallStack) => a -- ^ The expected value@@ -85,7 +85,7 @@ expected @=? actual = assertEqual "" expected actual -- | Asserts that the specified actual value is equal to the expected value--- (with the actual value on the left-hand side).+-- (with the /actual/ value on the left-hand side). (@?=) :: (Eq a, Show a, HasCallStack) => a -- ^ The actual value@@ -135,7 +135,8 @@ -- | Exception thrown by 'assertFailure' etc. data HUnitFailure = HUnitFailure (Maybe SrcLoc) String deriving (Eq, Show, Typeable)-instance E.Exception HUnitFailure+instance E.Exception HUnitFailure where+ displayException (HUnitFailure mbloc s) = prependLocation mbloc s prependLocation :: Maybe SrcLoc -> String -> String prependLocation mbloc s =@@ -166,12 +167,12 @@ -- -- Since an 'Assertion' can be a sequence of @Assertion@s and @IO@ actions, -- there is a fair amount of flexibility of what can be achieved. As a rule,--- the resulting @Assertion@ should be the body of a 'TestCase' or part of+-- the resulting @Assertion@ should be the body of a @TestCase@ or part of -- a @TestCase@; it should not be used to assert multiple, independent -- conditions. ----- If more complex arrangements of assertions are needed, 'Test's and--- 'Testable' should be used.+-- If more complex arrangements of assertions are needed, @Test@ and+-- @Testable@ should be used. class Assertable t where assert :: t -> Assertion
Test/Tasty/HUnit/Steps.hs view
@@ -16,19 +16,22 @@ deriving Typeable instance IsTest TestCaseSteps where- run _ (TestCaseSteps assertionFn) _ = do+ run _ (TestCaseSteps assertionFn) yieldProgress = do ref <- newIORef [] let stepFn :: String -> IO () stepFn msg = do tme <- getTime+ -- The number of steps is not fixed, so we can't + -- provide the progress percentage.+ -- We also don't provide the timings here, only+ -- at the end.+ yieldProgress (Progress msg 0) atomicModifyIORef ref (\l -> ((tme,msg):l, ())) - hunitResult <- (Right <$> assertionFn stepFn) `catches`- [ Handler (\(HUnitFailure mbloc errMsg) -> return $ Left (prependLocation mbloc errMsg))- , Handler (\(SomeException ex) -> return $ Left (show ex))- ]+ hunitResult <- (Right <$> assertionFn stepFn) `catch`+ \(SomeException ex) -> return $ Left (displayException ex) endTime <- getTime
tasty-hunit.cabal view
@@ -1,8 +1,5 @@--- Initial tasty-hunit.cabal generated by cabal init. For further --- documentation, see http://haskell.org/cabal/users-guide/- name: tasty-hunit-version: 0.10.0.2+version: 0.10.2 synopsis: HUnit support for the Tasty test framework. description: HUnit support for the Tasty test framework. .@@ -14,8 +11,8 @@ license-file: LICENSE author: Roman Cheplyaka <roma@ro-che.info> maintainer: Roman Cheplyaka <roma@ro-che.info>-homepage: https://github.com/feuerbach/tasty-bug-reports: https://github.com/feuerbach/tasty/issues+homepage: https://github.com/UnkindPartition/tasty+bug-reports: https://github.com/UnkindPartition/tasty/issues -- copyright: category: Testing build-type: Simple@@ -24,7 +21,7 @@ Source-repository head type: git- location: git://github.com/feuerbach/tasty.git+ location: https://github.com/UnkindPartition/tasty.git subdir: hunit library@@ -32,7 +29,9 @@ other-modules: Test.Tasty.HUnit.Orig Test.Tasty.HUnit.Steps other-extensions: TypeFamilies, DeriveDataTypeable- build-depends: base ==4.*, tasty >= 1.2.2, call-stack+ build-depends: base >= 4.8 && < 5,+ tasty >= 1.2.2 && < 1.6,+ call-stack < 0.5 -- hs-source-dirs: default-language: Haskell2010 ghc-options: -Wall