hspec-smallcheck-0.4.2/0000755000000000000000000000000013042245112013103 5ustar0000000000000000hspec-smallcheck-0.4.2/LICENSE0000644000000000000000000000206713042245112014115 0ustar0000000000000000Copyright (c) 2013-2015 Simon Hengel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. hspec-smallcheck-0.4.2/hspec-smallcheck.cabal0000644000000000000000000000206213042245112017275 0ustar0000000000000000name: hspec-smallcheck version: 0.4.2 license: MIT license-file: LICENSE copyright: (c) 2013-2015 Simon Hengel maintainer: Simon Hengel build-type: Simple cabal-version: >= 1.8 category: Testing bug-reports: https://github.com/hspec/hspec-smallcheck/issues homepage: http://hspec.github.io/ synopsis: SmallCheck support for the Hspec testing framework description: SmallCheck support for the Hspec testing framework source-repository head type: git location: https://github.com/hspec/hspec-smallcheck library ghc-options: -Wall hs-source-dirs: src exposed-modules: Test.Hspec.SmallCheck build-depends: base == 4.* , hspec-core >= 2.4 , smallcheck >= 1.0 test-suite spec type: exitcode-stdio-1.0 ghc-options: -Wall hs-source-dirs: test main-is: Spec.hs build-depends: base == 4.* , hspec , hspec-core , smallcheck , hspec-smallcheck , QuickCheck hspec-smallcheck-0.4.2/Setup.lhs0000644000000000000000000000011413042245112014707 0ustar0000000000000000#!/usr/bin/env runhaskell > import Distribution.Simple > main = defaultMain hspec-smallcheck-0.4.2/test/0000755000000000000000000000000013042245112014062 5ustar0000000000000000hspec-smallcheck-0.4.2/test/Spec.hs0000644000000000000000000000005413042245112015307 0ustar0000000000000000{-# OPTIONS_GHC -F -pgmF hspec-discover #-} hspec-smallcheck-0.4.2/src/0000755000000000000000000000000013042245112013672 5ustar0000000000000000hspec-smallcheck-0.4.2/src/Test/0000755000000000000000000000000013042245112014611 5ustar0000000000000000hspec-smallcheck-0.4.2/src/Test/Hspec/0000755000000000000000000000000013042245112015653 5ustar0000000000000000hspec-smallcheck-0.4.2/src/Test/Hspec/SmallCheck.hs0000644000000000000000000000144413042245112020220 0ustar0000000000000000{-# 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.Spec import Test.SmallCheck import Test.SmallCheck.Drivers property :: Testable IO a => a -> Property IO 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) maybe Success (Failure Nothing . Reason . ppFailure) <$> smallCheckWithHook (paramsSmallCheckDepth c) hook p