packages feed

quickcheck-io (empty) → 0.1.0

raw patch · 4 files changed

+66/−0 lines, 4 filesdep +HUnitdep +QuickCheckdep +basesetup-changed

Dependencies added: HUnit, QuickCheck, base

Files

+ LICENSE view
@@ -0,0 +1,19 @@+Copyright (c) 2013 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+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.
+ Setup.lhs view
@@ -0,0 +1,3 @@+#!/usr/bin/env runhaskell+> import Distribution.Simple+> main = defaultMain
+ quickcheck-io.cabal view
@@ -0,0 +1,29 @@+name:             quickcheck-io+version:          0.1.0+synopsis:         Use HUnit assertions as QuickCheck properties+description:      This package provides an orphan instance that allows you to+                  use HUnit assertions as QuickCheck properties.+category:         Testing+license:          MIT+license-file:     LICENSE+copyright:        (c) 2013 Simon Hengel+author:           Simon Hengel <sol@typeful.net>+maintainer:       Simon Hengel <sol@typeful.net>+build-type:       Simple+cabal-version:    >= 1.8++source-repository head+  type: git+  location: https://github.com/sol/quickcheck-io++library+  ghc-options:+      -Wall+  hs-source-dirs:+      src+  exposed-modules:+      Test.QuickCheck.IO+  build-depends:+      QuickCheck  >= 2.5.1+    , HUnit       >= 1.2.5+    , base        == 4.*
+ src/Test/QuickCheck/IO.hs view
@@ -0,0 +1,15 @@+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}+module Test.QuickCheck.IO where++import qualified Control.Exception as E+import           Test.HUnit.Lang (Assertion, HUnitFailure(..))+import           Test.QuickCheck.Property++instance Testable Assertion where+  property = propertyIO+  exhaustive _ = True++propertyIO :: Assertion -> Property+propertyIO action = morallyDubiousIOProperty $ do+  (action >> return succeeded) `E.catch` \(HUnitFailure err) -> return failed {reason = err}