packages feed

hspec-api 2.11.4 → 2.11.5

raw patch · 6 files changed

+77/−42 lines, 6 filesdep ~hspec-corePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: hspec-core

API changes (from Hackage documentation)

+ Test.Hspec.Api.Format.V2: [formatConfigFormatException] :: FormatConfig -> SomeException -> String
+ Test.Hspec.Api.Format.V2: defaultFormatConfig :: FormatConfig
+ Test.Hspec.Api.Formatters.V3: FormatConfig :: Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe (String -> String -> IO ()) -> Maybe (String -> String -> (String, String)) -> (SomeException -> String) -> Bool -> Bool -> Bool -> Integer -> Int -> FormatConfig
+ Test.Hspec.Api.Formatters.V3: [formatConfigDiffContext] :: FormatConfig -> Maybe Int
+ Test.Hspec.Api.Formatters.V3: [formatConfigExpectedTotalCount] :: FormatConfig -> Int
+ Test.Hspec.Api.Formatters.V3: [formatConfigExternalDiff] :: FormatConfig -> Maybe (String -> String -> IO ())
+ Test.Hspec.Api.Formatters.V3: [formatConfigFormatException] :: FormatConfig -> SomeException -> String
+ Test.Hspec.Api.Formatters.V3: [formatConfigHtmlOutput] :: FormatConfig -> Bool
+ Test.Hspec.Api.Formatters.V3: [formatConfigOutputUnicode] :: FormatConfig -> Bool
+ Test.Hspec.Api.Formatters.V3: [formatConfigPrettyPrintFunction] :: FormatConfig -> Maybe (String -> String -> (String, String))
+ Test.Hspec.Api.Formatters.V3: [formatConfigPrintCpuTime] :: FormatConfig -> Bool
+ Test.Hspec.Api.Formatters.V3: [formatConfigPrintTimes] :: FormatConfig -> Bool
+ Test.Hspec.Api.Formatters.V3: [formatConfigReportProgress] :: FormatConfig -> Bool
+ Test.Hspec.Api.Formatters.V3: [formatConfigUseColor] :: FormatConfig -> Bool
+ Test.Hspec.Api.Formatters.V3: [formatConfigUseDiff] :: FormatConfig -> Bool
+ Test.Hspec.Api.Formatters.V3: [formatConfigUsedSeed] :: FormatConfig -> Integer
+ Test.Hspec.Api.Formatters.V3: data FormatConfig
+ Test.Hspec.Api.Formatters.V3: defaultFormatConfig :: FormatConfig
+ Test.Hspec.Api.Formatters.V3: getConfig :: FormatM FormatConfig
+ Test.Hspec.Api.Formatters.V3: getConfigValue :: (FormatConfig -> a) -> FormatM a
- Test.Hspec.Api.Format.V2: FormatConfig :: Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe (String -> String -> IO ()) -> Maybe (String -> String -> (String, String)) -> Bool -> Bool -> Bool -> Integer -> Int -> FormatConfig
+ Test.Hspec.Api.Format.V2: FormatConfig :: Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe (String -> String -> IO ()) -> Maybe (String -> String -> (String, String)) -> (SomeException -> String) -> Bool -> Bool -> Bool -> Integer -> Int -> FormatConfig

Files

hspec-api.cabal view
@@ -1,17 +1,18 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2.+-- This file has been generated from package.yaml by hpack version 0.35.5. -- -- see: https://github.com/sol/hpack  name:           hspec-api-version:        2.11.4+version:        2.11.5 synopsis:       A Testing Framework for Haskell description:    This package provides a stable API that can be used to extend Hspec's functionality. category:       Testing stability:      stable homepage:       https://hspec.github.io/ bug-reports:    https://github.com/hspec/hspec/issues+author:         Simon Hengel <sol@typeful.net> maintainer:     Simon Hengel <sol@typeful.net> copyright:      (c) 2022-2023 Simon Hengel license:        MIT@@ -34,12 +35,13 @@       Test.Hspec.Api.Formatters.V3   other-modules:       Test.Hspec.Api.Format.V1.Internal+      Test.Hspec.Api.Format.V2.Config   hs-source-dirs:       src   ghc-options: -Wall   build-depends:       base ==4.*-    , hspec-core ==2.11.4+    , hspec-core ==2.11.5     , transformers   default-language: Haskell2010 @@ -62,6 +64,6 @@       base ==4.*     , hspec ==2.*     , hspec-api-    , hspec-core ==2.11.4+    , hspec-core ==2.11.5     , transformers   default-language: Haskell2010
src/Test/Hspec/Api/Format/V2.hs view
@@ -4,6 +4,7 @@ module Test.Hspec.Api.Format.V2 (   Format , FormatConfig(..)+, defaultFormatConfig , Event(..) , Progress , Path@@ -27,9 +28,11 @@  import           Test.Hspec.Core.Runner (Config(..)) import           Test.Hspec.Core.Spec (modifyConfig, SpecWith)-import           Test.Hspec.Core.Format hiding (FormatConfig(..))+import           Test.Hspec.Core.Format hiding (FormatConfig(..), defaultFormatConfig) import qualified Test.Hspec.Core.Format as Latest +import           Test.Hspec.Api.Format.V2.Config+ -- | -- Make a formatter available for use with @--format@. registerFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config@@ -50,34 +53,3 @@   where     liftFormat :: (FormatConfig -> IO Format) -> Latest.FormatConfig -> IO Format     liftFormat format = format . unliftFormatConfig--data FormatConfig = FormatConfig {-  formatConfigUseColor :: Bool-, formatConfigReportProgress :: Bool-, formatConfigOutputUnicode :: Bool-, formatConfigUseDiff :: Bool-, formatConfigDiffContext :: Maybe Int-, formatConfigExternalDiff :: Maybe (String -> String -> IO ())-, formatConfigPrettyPrintFunction :: Maybe (String -> String -> (String, String))-, formatConfigPrintTimes :: Bool-, formatConfigHtmlOutput :: Bool-, formatConfigPrintCpuTime :: Bool-, formatConfigUsedSeed :: Integer-, formatConfigExpectedTotalCount :: Int-}--unliftFormatConfig :: Latest.FormatConfig -> FormatConfig-unliftFormatConfig config = FormatConfig {-  formatConfigUseColor = Latest.formatConfigUseColor config-, formatConfigReportProgress = Latest.formatConfigReportProgress config-, formatConfigOutputUnicode = Latest.formatConfigOutputUnicode config-, formatConfigUseDiff = Latest.formatConfigUseDiff config-, formatConfigDiffContext = Latest.formatConfigDiffContext config-, formatConfigExternalDiff = Latest.formatConfigExternalDiff config-, formatConfigPrettyPrintFunction = Latest.formatConfigPrettyPrintFunction config-, formatConfigPrintTimes = Latest.formatConfigPrintTimes config-, formatConfigHtmlOutput = Latest.formatConfigHtmlOutput config-, formatConfigPrintCpuTime = Latest.formatConfigPrintCpuTime config-, formatConfigUsedSeed = Latest.formatConfigUsedSeed config-, formatConfigExpectedTotalCount = Latest.formatConfigExpectedTotalCount config-}
+ src/Test/Hspec/Api/Format/V2/Config.hs view
@@ -0,0 +1,41 @@+module Test.Hspec.Api.Format.V2.Config where++import           Control.Exception (SomeException)+import qualified Test.Hspec.Core.Format as Latest++data FormatConfig = FormatConfig {+  formatConfigUseColor :: Bool+, formatConfigReportProgress :: Bool+, formatConfigOutputUnicode :: Bool+, formatConfigUseDiff :: Bool+, formatConfigDiffContext :: Maybe Int+, formatConfigExternalDiff :: Maybe (String -> String -> IO ())+, formatConfigPrettyPrintFunction :: Maybe (String -> String -> (String, String))+, formatConfigFormatException :: SomeException -> String -- ^ @since 2.11.5+, formatConfigPrintTimes :: Bool+, formatConfigHtmlOutput :: Bool+, formatConfigPrintCpuTime :: Bool+, formatConfigUsedSeed :: Integer+, formatConfigExpectedTotalCount :: Int+}++-- ^ @since 2.11.5+defaultFormatConfig :: FormatConfig+defaultFormatConfig = unliftFormatConfig Latest.defaultFormatConfig++unliftFormatConfig :: Latest.FormatConfig -> FormatConfig+unliftFormatConfig config = FormatConfig {+  formatConfigUseColor = Latest.formatConfigUseColor config+, formatConfigReportProgress = Latest.formatConfigReportProgress config+, formatConfigOutputUnicode = Latest.formatConfigOutputUnicode config+, formatConfigUseDiff = Latest.formatConfigUseDiff config+, formatConfigDiffContext = Latest.formatConfigDiffContext config+, formatConfigExternalDiff = Latest.formatConfigExternalDiff config+, formatConfigPrettyPrintFunction = Latest.formatConfigPrettyPrintFunction config+, formatConfigFormatException = Latest.formatConfigFormatException config+, formatConfigPrintTimes = Latest.formatConfigPrintTimes config+, formatConfigHtmlOutput = Latest.formatConfigHtmlOutput config+, formatConfigPrintCpuTime = Latest.formatConfigPrintCpuTime config+, formatConfigUsedSeed = Latest.formatConfigUsedSeed config+, formatConfigExpectedTotalCount = Latest.formatConfigExpectedTotalCount config+}
src/Test/Hspec/Api/Formatters/V2.hs view
@@ -106,6 +106,8 @@   , useFormatter   , formatterToFormat +  , FormatConfig+   , silent   , checks   , specdoc
src/Test/Hspec/Api/Formatters/V3.hs view
@@ -47,6 +47,12 @@ , FailureReason (..) , FormatM +-- ** Accessing config values+, getConfig+, getConfigValue+, FormatConfig(..)+, defaultFormatConfig+ -- ** Accessing the runner state , getSuccessCount , getPendingCount@@ -98,11 +104,22 @@ , modifyConfig ) where -import Test.Hspec.Core.Formatters.V2-import Test.Hspec.Core.Runner (Config(..))-import Test.Hspec.Core.Format (FormatConfig, Format)-import Test.Hspec.Core.Spec (modifyConfig, SpecWith)+import           Test.Hspec.Core.Formatters.V2 hiding (FormatConfig(..), getConfig, getConfigValue)+import qualified Test.Hspec.Core.Formatters.V2 as Core+import           Test.Hspec.Core.Runner (Config(..))+import           Test.Hspec.Core.Format (Format)+import           Test.Hspec.Core.Spec (modifyConfig, SpecWith) +import           Test.Hspec.Api.Format.V2.Config++-- | @since 2.11.5+getConfig :: FormatM FormatConfig+getConfig = unliftFormatConfig <$> Core.getConfig++-- | @since 2.11.5+getConfigValue :: (FormatConfig -> a) -> FormatM a+getConfigValue f = f <$> getConfig+ -- | -- Make a formatter available for use with @--format@. registerFormatter :: (String, Formatter) -> Config -> Config@@ -114,5 +131,5 @@ useFormatter (fmap formatterToFormat -> formatter@(_, format)) config = (registerFormatter_ formatter config) { configFormat = Just format }  -- copy of Test.Hspec.Core.Runner.registerFormatter-registerFormatter_ :: (String, FormatConfig -> IO Format) -> Config -> Config+registerFormatter_ :: (String, Core.FormatConfig -> IO Format) -> Config -> Config registerFormatter_ formatter config = config { configAvailableFormatters = formatter : configAvailableFormatters config }
version.yaml view
@@ -1,5 +1,6 @@-version: &version 2.11.4+version: &version 2.11.5 synopsis: A Testing Framework for Haskell+author: Simon Hengel <sol@typeful.net> maintainer: Simon Hengel <sol@typeful.net> category: Testing stability: experimental