hspec-meta 2.11.16 → 2.11.17
raw patch · 10 files changed
+12/−70 lines, 10 filesdep ~QuickCheck
Dependency ranges changed: QuickCheck
Files
- LICENSE +1/−1
- hspec-core/src/Test/Hspec/Core/Config/Definition.hs +0/−12
- hspec-core/src/Test/Hspec/Core/Formatters/Pretty/Parser.hs +0/−4
- hspec-core/src/Test/Hspec/Core/Hooks.hs +4/−2
- hspec-core/src/Test/Hspec/Core/Runner.hs +1/−10
- hspec-core/src/Test/Hspec/Core/Spec.hs +0/−12
- hspec-core/src/Test/Hspec/Core/Spec/Monad.hs +0/−13
- hspec-meta.cabal +6/−6
- hspec/src/Test/Hspec.hs +0/−5
- hspec/src/Test/Hspec/Discover.hs +0/−5
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/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
hspec-core/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
hspec-core/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.
hspec-core/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
hspec-core/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
hspec-core/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])
hspec-meta.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hspec-meta-version: 2.11.16+version: 2.11.17 synopsis: A version of Hspec which is used to test Hspec itself description: A stable version of Hspec which is used to test the in-development version of Hspec.@@ -15,7 +15,7 @@ bug-reports: https://github.com/hspec/hspec/issues author: Simon Hengel <sol@typeful.net> maintainer: Simon Hengel <sol@typeful.net>-copyright: (c) 2011-2025 Simon Hengel,+copyright: (c) 2011-2026 Simon Hengel, (c) 2011-2012 Trystan Spangler, (c) 2011 Greg Weber license: MIT@@ -95,7 +95,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@@ -115,7 +115,7 @@ if impl(ghc) 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@@ -138,7 +138,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@@ -160,7 +160,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
hspec/src/Test/Hspec.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} -- | -- Stability: stable --@@ -51,7 +50,6 @@ , fdescribe , fcontext -#ifdef ENABLE_SPEC_HOOKS -- * Hooks , ActionWith , before@@ -72,16 +70,13 @@ , aroundAllWith , mapSubject , ignoreSubject-#endif -- * Running a spec , hspec ) where import Test.Hspec.Core.Spec-#ifdef ENABLE_SPEC_HOOKS import Test.Hspec.Core.Hooks-#endif import Test.Hspec.Runner import Test.Hspec.Expectations
hspec/src/Test/Hspec/Discover.hs view
@@ -1,16 +1,13 @@ {-# OPTIONS_GHC -fno-warn-deprecations #-} {-# OPTIONS_HADDOCK hide #-}-{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} module Test.Hspec.Discover {-# WARNING "This module is used by @hspec-discover@. It is not part of the public API and may change at any time." #-} ( Spec , hspec-#ifdef ENABLE_LEGACY_V1_FORMATTERS , IsFormatter (..) , hspecWithFormatter-#endif , postProcessSpec , describe , module Prelude@@ -18,7 +15,6 @@ import Test.Hspec.Core.Spec import Test.Hspec.Core.Runner-#ifdef ENABLE_LEGACY_V1_FORMATTERS import Test.Hspec.Core.Formatters.V1 class IsFormatter a where@@ -34,7 +30,6 @@ hspecWithFormatter formatter spec = do f <- toFormatter formatter hspecWith defaultConfig {configFormatter = Just f} spec-#endif postProcessSpec :: FilePath -> Spec -> Spec postProcessSpec _ = id