quickcheck-simple-0.1.1.1: Test properties and default-mains for QuickCheck

Copyright | 2015-2019 Kei Hibino
License | BSD3
Maintainer | ex8k.hibino@gmail.com
Stability | experimental
Portability | unknown
Safe Haskell | Safe-Inferred
Language | Haskell2010

Test.QuickCheck.Simple

Description

This module contains definitions of test properties and default-mains using QuickCheck library.

Synopsis

- data Property
  - = Bool (Maybe String) Bool
  - | QuickCheck Property
- boolTest' :: String -> String -> Bool -> Test
- boolTest :: String -> Bool -> Test
- eqTest' :: (a -> a -> Bool) -> (a -> String) -> String -> a -> a -> Test
- eqTest :: (Eq a, Show a) => String -> a -> a -> Test
- qcTest :: Testable prop => String -> prop -> Test
- type Test = (String, Property)
- data TestError
  - = BFalse (Maybe String)
  - | QCError Result
- runTest_ :: Bool -> Test -> IO (Maybe TestError)
- runTest :: Test -> IO (Maybe TestError)
- defaultMain_ :: Bool -> [Test] -> IO ()
- defaultMain :: [Test] -> IO ()
- verboseMain :: [Test] -> IO ()
- defaultMain' :: Bool -> [Test] -> IO ()

# Documentation

data Property Source #

Property type. `Bool` or `Testable` of QuickCheck.

Constructors

Bool (Maybe String) Bool |
QuickCheck Property |

boolTest' :: String -> String -> Bool -> Test Source #

`Bool` specialized property with message for False case

boolTest :: String -> Bool -> Test Source #

`Bool` specialized property

eqTest' :: (a -> a -> Bool) -> (a -> String) -> String -> a -> a -> Test Source #

`Eq` specialized property with explicit passing

eqTest :: (Eq a, Show a) => String -> a -> a -> Test Source #

`Eq` specialized property

qcTest :: Testable prop => String -> prop -> Test Source #

QuickCheck `Testable` property

type Test = (String, Property) Source #

Property with label string

data TestError Source #

Test failure result.

Constructors

BFalse (Maybe String) |
QCError Result |

#### Instances

Instances details

Show TestError Source # |
Instance details Defined in Test.QuickCheck.Simple Methods showsPrec :: Int -> TestError -> ShowS Source # show :: TestError -> String Source # showList :: [TestError] -> ShowS Source #

runTest_ Source #

Arguments

:: Bool | verbose flag
-> Test | property to test
-> IO (Maybe TestError) | result action, and may be failure result

Run a single test suite.

runTest Source #

Arguments

:: Test | property to test
-> IO (Maybe TestError) | result action, and may be failure result

Not verbose version of runTest_

defaultMain_ :: Bool -> [Test] -> IO () Source #

Default main to run test suites.

defaultMain :: [Test] -> IO () Source #

Not verbose version of `defaultMain'`.

verboseMain :: [Test] -> IO () Source #

Verbose verison of defaultMain

defaultMain' :: Bool -> [Test] -> IO () Source #

Deprecated: Use defaultMain_ instead of this.