hspec-core 2.11.16 → 2.11.17
raw patch · 9 files changed
+25/−78 lines, 9 filesdep ~QuickCheckdep ~hspec-meta
Dependency ranges changed: QuickCheck, hspec-meta
Files
- LICENSE +1/−1
- hspec-core.cabal +18/−23
- src/Test/Hspec/Core/Config/Definition.hs +0/−12
- src/Test/Hspec/Core/Formatters/Pretty/Parser.hs +0/−4
- src/Test/Hspec/Core/Hooks.hs +4/−2
- src/Test/Hspec/Core/Runner.hs +1/−10
- src/Test/Hspec/Core/Spec.hs +0/−12
- src/Test/Hspec/Core/Spec/Monad.hs +0/−13
- version.yaml +1/−1
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2011-2025 Simon Hengel <sol@typeful.net>+Copyright (c) 2011-2026 Simon Hengel <sol@typeful.net> Copyright (c) 2011-2012 Trystan Spangler <trystan.s@comcast.net> Copyright (c) 2011-2011 Greg Weber <greg@gregweber.info>
hspec-core.cabal view
@@ -5,10 +5,10 @@ -- see: https://github.com/sol/hpack name: hspec-core-version: 2.11.16+version: 2.11.17 license: MIT license-file: LICENSE-copyright: (c) 2011-2025 Simon Hengel,+copyright: (c) 2011-2026 Simon Hengel, (c) 2011-2012 Trystan Spangler, (c) 2011 Greg Weber maintainer: Simon Hengel <sol@typeful.net>@@ -36,7 +36,7 @@ ghc-options: -Wall -fno-warn-incomplete-uni-patterns build-depends: HUnit ==1.6.*- , QuickCheck >=2.13.1 && <2.18+ , QuickCheck >=2.13.1 && <2.19 , ansi-terminal >=0.6.2 , array , base >=4.9.0.0 && <5@@ -60,8 +60,11 @@ Test.Hspec.Core.Extension.Option Test.Hspec.Core.Extension.Config Test.Hspec.Core.Spec+ Test.Hspec.Core.Hooks Test.Hspec.Core.Runner Test.Hspec.Core.Format+ Test.Hspec.Core.Formatters+ Test.Hspec.Core.Formatters.V1 Test.Hspec.Core.Formatters.V2 Test.Hspec.Core.QuickCheck Test.Hspec.Core.Util@@ -86,6 +89,9 @@ Test.Hspec.Core.Formatters.Pretty Test.Hspec.Core.Formatters.Pretty.Parser Test.Hspec.Core.Formatters.Pretty.Unicode+ Test.Hspec.Core.Formatters.V1.Free+ Test.Hspec.Core.Formatters.V1.Internal+ Test.Hspec.Core.Formatters.V1.Monad Test.Hspec.Core.QuickCheck.Util Test.Hspec.Core.Runner.Eval Test.Hspec.Core.Runner.JobQueue@@ -103,7 +109,7 @@ Control.Concurrent.Async hs-source-dirs: vendor/async-2.2.5/- cpp-options: -DENABLE_SPEC_HOOKS -DENABLE_SPEC_HOOK_ARGS -DENABLE_LEGACY_V1_FORMATTERS+ cpp-options: -DENABLE_SPEC_HOOK_ARGS if impl(ghc >= 8.4.1) build-depends: stm >=2.2@@ -112,15 +118,6 @@ Control.Concurrent.STM.TMVar hs-source-dirs: vendor/stm-2.5.0.1/- if impl(ghc)- exposed-modules:- Test.Hspec.Core.Hooks- Test.Hspec.Core.Formatters- Test.Hspec.Core.Formatters.V1- other-modules:- Test.Hspec.Core.Formatters.V1.Free- Test.Hspec.Core.Formatters.V1.Internal- Test.Hspec.Core.Formatters.V1.Monad test-suite spec type: exitcode-stdio-1.0@@ -145,7 +142,7 @@ , filepath , haskell-lexer , hspec-expectations ==0.8.4.*- , hspec-meta ==2.11.16+ , hspec-meta ==2.11.17 , process , quickcheck-io >=0.2.0 , random@@ -178,12 +175,18 @@ Test.Hspec.Core.Extension.Tree Test.Hspec.Core.FailureReport Test.Hspec.Core.Format+ Test.Hspec.Core.Formatters Test.Hspec.Core.Formatters.Diff Test.Hspec.Core.Formatters.Internal Test.Hspec.Core.Formatters.Pretty Test.Hspec.Core.Formatters.Pretty.Parser Test.Hspec.Core.Formatters.Pretty.Unicode+ Test.Hspec.Core.Formatters.V1+ Test.Hspec.Core.Formatters.V1.Free+ Test.Hspec.Core.Formatters.V1.Internal+ Test.Hspec.Core.Formatters.V1.Monad Test.Hspec.Core.Formatters.V2+ Test.Hspec.Core.Hooks Test.Hspec.Core.QuickCheck Test.Hspec.Core.QuickCheck.Util Test.Hspec.Core.Runner@@ -239,7 +242,7 @@ Control.Concurrent.Async hs-source-dirs: vendor/async-2.2.5/- cpp-options: -DENABLE_SPEC_HOOKS -DENABLE_SPEC_HOOK_ARGS -DENABLE_LEGACY_V1_FORMATTERS+ cpp-options: -DENABLE_SPEC_HOOK_ARGS if impl(ghc >= 8.4.1) build-depends: stm >=2.2@@ -248,11 +251,3 @@ Control.Concurrent.STM.TMVar hs-source-dirs: vendor/stm-2.5.0.1/- if impl(ghc)- other-modules:- Test.Hspec.Core.Hooks- Test.Hspec.Core.Formatters- Test.Hspec.Core.Formatters.V1- Test.Hspec.Core.Formatters.V1.Free- Test.Hspec.Core.Formatters.V1.Internal- Test.Hspec.Core.Formatters.V1.Monad
src/Test/Hspec/Core/Config/Definition.hs view
@@ -14,9 +14,7 @@ , getExtensionOptions , getSeed-#ifdef ENABLE_LEGACY_V1_FORMATTERS , getFormatter-#endif , commandLineOnlyOptions , formatterOptions@@ -44,10 +42,8 @@ import Test.Hspec.Core.Format (Format, FormatConfig) import Test.Hspec.Core.Formatters.Pretty (pretty2)-#ifdef ENABLE_LEGACY_V1_FORMATTERS import qualified Test.Hspec.Core.Formatters.V1.Monad as V1 import qualified Test.Hspec.Core.Formatters.V1.Internal as V1 (formatterToFormat)-#endif import Test.Hspec.Core.Util import GetOpt.Declarative@@ -69,10 +65,8 @@ getExtensionOptions :: Config -> [(String, [Option Config])] getExtensionOptions = maybe [] unExtensionOptions . getConfigAnnotation -#ifdef ENABLE_LEGACY_V1_FORMATTERS getFormatter :: Config -> Maybe (FormatConfig -> IO Format) getFormatter config = configFormat config <|> V1.formatterToFormat <$> configFormatter config-#endif getSeed :: Config -> Maybe Integer getSeed config = configSeed config <|> configQuickCheckSeed config@@ -131,16 +125,12 @@ , configExpertMode :: Bool -- ^ @since 2.11.2 , configAvailableFormatters :: [(String, FormatConfig -> IO Format)] -- ^ @since 2.9.0 , configFormat :: Maybe (FormatConfig -> IO Format)-#ifdef ENABLE_LEGACY_V1_FORMATTERS , configFormatter :: Maybe V1.Formatter-#endif , configHtmlOutput :: Bool , configConcurrentJobs :: Maybe Int , configAnnotations :: Annotations }-#ifdef ENABLE_LEGACY_V1_FORMATTERS {-# DEPRECATED configFormatter "Use [@useFormatter@](https://hackage.haskell.org/package/hspec-api/docs/Test-Hspec-Api-Formatters-V1.html#v:useFormatter) instead." #-}-#endif {-# DEPRECATED configQuickCheckSeed "Use `configSeed` instead." #-} mkDefaultConfig :: [(String, FormatConfig -> IO Format)] -> Config@@ -180,9 +170,7 @@ , configExpertMode = False , configAvailableFormatters = formatters , configFormat = Nothing-#ifdef ENABLE_LEGACY_V1_FORMATTERS , configFormatter = Nothing-#endif , configHtmlOutput = False , configConcurrentJobs = Nothing , configAnnotations = mempty
src/Test/Hspec/Core/Formatters/Pretty/Parser.hs view
@@ -30,11 +30,7 @@ type TokenType = Lexer.Token -#ifndef __MHS__ newtype Parser a = Parser {-#else-data Parser a = Parser {-#endif runParser :: [Token] -> Maybe (a, [Token]) } deriving Functor
src/Test/Hspec/Core/Hooks.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE RecordWildCards #-} -- | Stability: provisional module Test.Hspec.Core.Hooks ( -- * Types@@ -127,8 +128,9 @@ aroundWith = mapSpecItem_ . modifyHook modifyHook :: (ActionWith a -> ActionWith b) -> Item a -> Item b-modifyHook action item = item {- itemExample = \ params hook -> itemExample item params (hook . action)+modifyHook action Item{..} = Item {+ itemExample = \ params hook -> itemExample params (hook . action)+ , .. } -- | Wrap an action around the given spec.
src/Test/Hspec/Core/Runner.hs view
@@ -118,12 +118,7 @@ import Test.Hspec.Core.Spec hiding (pruneTree, pruneForest) import Test.Hspec.Core.Tree (formatDefaultDescription) import Test.Hspec.Core.Config-import Test.Hspec.Core.Config.Definition as Config (getSeed)--#ifdef ENABLE_LEGACY_V1_FORMATTERS-import Test.Hspec.Core.Config.Definition as Config (getFormatter)-#endif-+import Test.Hspec.Core.Config.Definition as Config (getSeed, getFormatter) import Test.Hspec.Core.Extension.Config.Type as Extension (applySpecTransformation) import Test.Hspec.Core.Format (Format, FormatConfig(..)) import qualified Test.Hspec.Core.Formatters.V2 as V2@@ -399,11 +394,7 @@ } formatter :: FormatConfig -> IO Format-#ifdef ENABLE_LEGACY_V1_FORMATTERS formatter = fromMaybe (V2.formatterToFormat V2.checks) (Config.getFormatter config)-#else- formatter = V2.formatterToFormat V2.checks-#endif format <- maybe id printSlowSpecItems (configPrintSlowItems config) <$> formatter formatConfig
src/Test/Hspec/Core/Spec.hs view
@@ -96,9 +96,7 @@ import Test.Hspec.Expectations (Expectation) import Test.Hspec.Core.Example-#ifdef ENABLE_SPEC_HOOKS import Test.Hspec.Core.Hooks-#endif import Test.Hspec.Core.Tree import Test.Hspec.Core.Spec.Monad import Test.Hspec.Core.QuickCheck ()@@ -118,11 +116,7 @@ -- -- This can be used to temporarily disable spec items. xdescribe :: HasCallStack => String -> SpecWith a -> SpecWith a-#ifdef ENABLE_SPEC_HOOKS xdescribe label spec = before_ pending_ $ describe label spec-#else-xdescribe = describe-#endif -- | @xcontext@ is an alias for `xdescribe`. xcontext :: HasCallStack => String -> SpecWith a -> SpecWith a@@ -161,11 +155,7 @@ -- -- This can be used to temporarily disable a spec item. xit :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)-#ifdef ENABLE_SPEC_HOOKS xit label action = before_ pending_ $ it label action-#else-xit = it-#endif -- | @xspecify@ is an alias for `xit`. xspecify :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)@@ -222,10 +212,8 @@ pending :: HasCallStack => Expectation pending = throwIO (Pending location Nothing) -#ifdef ENABLE_SPEC_HOOKS pending_ :: Expectation pending_ = (throwIO (Pending Nothing Nothing))-#endif -- | -- `pendingWith` is similar to `pending`, but it takes an additional string
src/Test/Hspec/Core/Spec/Monad.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Test.Hspec.Core.Spec.Monad ( -- RE-EXPORTED from Test.Hspec.Core.Spec@@ -65,20 +64,8 @@ -- -- It allows for dynamically generated spec trees, for example, by using data -- obtained by performing IO actions with 'runIO'.-#ifndef __MHS__ newtype SpecM a r = SpecM { unSpecM :: WriterT (Endo Config, [SpecTree a]) (ReaderT Env IO) r } deriving (Functor, Applicative, Monad)-#else-data SpecM a r = SpecM { unSpecM :: WriterT (Endo Config, [SpecTree a]) (ReaderT Env IO) r }- deriving Functor--instance Applicative (SpecM a) where- pure x = SpecM $ pure x- SpecM f <*> SpecM x = SpecM $ f <*> x--instance Monad (SpecM a) where- SpecM m >>= k = SpecM $ m >>= unSpecM . k-#endif -- | Convert a `Spec` to a forest of `SpecTree`s. runSpecM :: SpecWith a -> IO (Endo Config, [SpecTree a])
version.yaml view
@@ -1,4 +1,4 @@-version: &version 2.11.16+version: &version 2.11.17 synopsis: A Testing Framework for Haskell author: Simon Hengel <sol@typeful.net> maintainer: Simon Hengel <sol@typeful.net>