packages feed

hspec-core 2.5.8 → 2.5.9

raw patch · 3 files changed

+28/−6 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Test.Hspec.Core.Formatters: Error :: (Maybe String) -> SomeException -> FailureReason
+ Test.Hspec.Core.Formatters: Error :: Maybe String -> SomeException -> FailureReason
- Test.Hspec.Core.Formatters: ExpectedButGot :: (Maybe String) -> String -> String -> FailureReason
+ Test.Hspec.Core.Formatters: ExpectedButGot :: Maybe String -> String -> String -> FailureReason
- Test.Hspec.Core.Formatters: Formatter :: FormatM () -> [String] -> String -> FormatM () -> FormatM () -> Path -> Progress -> FormatM () -> Path -> String -> FormatM () -> Path -> String -> FailureReason -> FormatM () -> Path -> String -> Maybe String -> FormatM () -> FormatM () -> FormatM () -> Formatter
+ Test.Hspec.Core.Formatters: Formatter :: FormatM () -> ([String] -> String -> FormatM ()) -> FormatM () -> (Path -> Progress -> FormatM ()) -> (Path -> String -> FormatM ()) -> (Path -> String -> FailureReason -> FormatM ()) -> (Path -> String -> Maybe String -> FormatM ()) -> FormatM () -> FormatM () -> Formatter
- Test.Hspec.Core.Spec: Error :: (Maybe String) -> SomeException -> FailureReason
+ Test.Hspec.Core.Spec: Error :: Maybe String -> SomeException -> FailureReason
- Test.Hspec.Core.Spec: ExpectedButGot :: (Maybe String) -> String -> String -> FailureReason
+ Test.Hspec.Core.Spec: ExpectedButGot :: Maybe String -> String -> String -> FailureReason
- Test.Hspec.Core.Spec: Failure :: (Maybe Location) -> FailureReason -> ResultStatus
+ Test.Hspec.Core.Spec: Failure :: Maybe Location -> FailureReason -> ResultStatus
- Test.Hspec.Core.Spec: Item :: String -> Maybe Location -> Maybe Bool -> Params -> (ActionWith a -> IO ()) -> ProgressCallback -> IO Result -> Item a
+ Test.Hspec.Core.Spec: Item :: String -> Maybe Location -> Maybe Bool -> (Params -> (ActionWith a -> IO ()) -> ProgressCallback -> IO Result) -> Item a
- Test.Hspec.Core.Spec: Pending :: (Maybe Location) -> (Maybe String) -> ResultStatus
+ Test.Hspec.Core.Spec: Pending :: Maybe Location -> Maybe String -> ResultStatus
- Test.Hspec.Core.Spec: SpecM :: (WriterT [SpecTree a] IO r) -> SpecM a r
+ Test.Hspec.Core.Spec: SpecM :: WriterT [SpecTree a] IO r -> SpecM a r

Files

hspec-core.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.30.0.+-- This file has been generated from package.yaml by hpack version 0.31.0. -- -- see: https://github.com/sol/hpack ----- hash: 2816c495eba299470f8178ab0162b41c33ff43fdd8c7d53ed3743386b018f184+-- hash: 2087cd0eed0044b84e5ce82bceae9d7b2dfae467b554bef674a8815445f7dd5b  name:             hspec-core-version:          2.5.8+version:          2.5.9 license:          MIT license-file:     LICENSE copyright:        (c) 2011-2018 Simon Hengel,
src/Test/Hspec/Core/Example/Location.hs view
@@ -26,7 +26,11 @@ } deriving (Eq, Show, Read)  extractLocation :: SomeException -> Maybe Location-extractLocation e = locationFromErrorCall e <|> locationFromPatternMatchFail e <|> locationFromIOException e+extractLocation e =+      locationFromErrorCall e+  <|> locationFromPatternMatchFail e+  <|> locationFromRecConError e+  <|> locationFromIOException e  locationFromErrorCall :: SomeException -> Maybe Location locationFromErrorCall e = case fromException e of@@ -42,6 +46,11 @@ locationFromPatternMatchFail :: SomeException -> Maybe Location locationFromPatternMatchFail e = case fromException e of   Just (PatternMatchFail s) -> listToMaybe (words s) >>= parseSourceSpan+  Nothing -> Nothing++locationFromRecConError :: SomeException -> Maybe Location+locationFromRecConError e = case fromException e of+  Just (RecConError s) -> listToMaybe (words s) >>= parseSourceSpan   Nothing -> Nothing  locationFromIOException :: SomeException -> Maybe Location
test/Test/Hspec/Core/Example/LocationSpec.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}+{-# OPTIONS_GHC -fno-warn-missing-fields #-} module Test.Hspec.Core.Example.LocationSpec (spec) where  import           Helper@@ -8,6 +9,11 @@ import           Test.Hspec.Core.Example import           Test.Hspec.Core.Example.Location +data Person = Person {+  name :: String+, age :: Int+} deriving (Eq, Show)+ spec :: Spec spec = do   describe "extractLocation" $ do@@ -46,20 +52,27 @@         extractLocation e `shouldBe` location      context "with PatternMatchFail" $ do-      context "with single-line source space" $ do+      context "with single-line source span" $ do         it "extracts Location" $ do           let             location = Just $ Location __FILE__ (__LINE__ + 1) 40           Left e <- try (evaluate (let Just n = Nothing in (n :: Int)))           extractLocation e `shouldBe` location -      context "with multi-line source space" $ do+      context "with multi-line source span" $ do         it "extracts Location" $ do           let location = Just $ Location __FILE__ (__LINE__ + 1) 36           Left e <- try (evaluate (case Nothing of             Just n -> n :: Int             ))           extractLocation e `shouldBe` location++    context "with RecConError" $ do+      it "extracts Location" $ do+        let+          location = Just $ Location __FILE__ (__LINE__ + 1) 39+        Left e <- try $ evaluate (age Person {name = "foo"})+        extractLocation e `shouldBe` location    describe "parseCallStack" $ do     it "parses Location from call stack" $ do