packages feed

hspec-smallcheck 0.3.0 → 0.4.1

raw patch · 3 files changed

+17/−9 lines, 3 filesdep +hspec-coredep ~hspecnew-uploaderPVP ok

version bump matches the API change (PVP)

Dependencies added: hspec-core

Dependency ranges changed: hspec

API changes (from Hackage documentation)

Files

LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2013 Simon Hengel <sol@typeful.net>+Copyright (c) 2013-2015 Simon Hengel <sol@typeful.net>  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
hspec-smallcheck.cabal view
@@ -1,8 +1,8 @@ name:             hspec-smallcheck-version:          0.3.0+version:          0.4.1 license:          MIT license-file:     LICENSE-copyright:        (c) 2013 Simon Hengel+copyright:        (c) 2013-2015 Simon Hengel maintainer:       Simon Hengel <sol@typeful.net> build-type:       Simple cabal-version:    >= 1.8@@ -24,15 +24,15 @@   exposed-modules:       Test.Hspec.SmallCheck   build-depends:-      base              == 4.*-    , hspec             >= 1.10-    , smallcheck        >= 1.0+      base == 4.*+    , hspec-core == 2.*+    , smallcheck >= 1.0  test-suite spec   type:       exitcode-stdio-1.0   ghc-options:-      -Wall -Werror+      -Wall   hs-source-dirs:       test   main-is:@@ -40,6 +40,7 @@   build-depends:       base              == 4.*     , hspec+    , hspec-core     , smallcheck      , hspec-smallcheck
src/Test/Hspec/SmallCheck.hs view
@@ -1,10 +1,12 @@-{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}+{-# LANGUAGE TypeFamilies, FlexibleInstances, FlexibleContexts, CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Test.Hspec.SmallCheck (property) where +#if !MIN_VERSION_base(4,8,0) import           Control.Applicative+#endif import           Data.IORef-import           Test.Hspec.Core+import           Test.Hspec.Core.Spec import           Test.SmallCheck import           Test.SmallCheck.Drivers @@ -12,10 +14,15 @@ property = test  instance Example (Property IO) where+  type Arg (Property IO) = ()   evaluateExample p c _ reportProgress = do     counter <- newIORef 0     let hook _ = do           modifyIORef counter succ           n <- readIORef counter           reportProgress (n, 0)+#if MIN_VERSION_hspec_core(2,2,0)+    maybe Success (Fail Nothing . ppFailure) <$> smallCheckWithHook (paramsSmallCheckDepth c) hook p+#else     maybe Success (Fail . ppFailure) <$> smallCheckWithHook (paramsSmallCheckDepth c) hook p+#endif