Hoogle Search

Within LTS Haskell 8.12 (ghc-8.0.2)

  1. quickCheck :: Testable prop => prop -> IO ()

    QuickCheck Test.QuickCheck

    Tests a property and prints the results to stdout.

  2. quickCheck :: Testable prop => prop -> IO ()

    QuickCheck Test.QuickCheck.Test

    Tests a property and prints the results to stdout.

  3. quickCheck :: NormalizationMode -> Text -> Maybe Bool

    text-icu Data.Text.ICU

    Perform an efficient check on a string, to quickly determine if the string is in a particular normalization form. A Nothing result indicates that a definite answer could not be determined quickly, and a more thorough check is required, e.g. with isNormalized. The user may have to convert the string to its normalized form and compare the results. A result of Just True or Just False indicates that the string definitely is, or is not, in the given normalization form.

  4. quickCheck :: NormalizationMode -> Text -> Maybe Bool

    text-icu Data.Text.ICU.Normalize

    Perform an efficient check on a string, to quickly determine if the string is in a particular normalization form. A Nothing result indicates that a definite answer could not be determined quickly, and a more thorough check is required, e.g. with isNormalized. The user may have to convert the string to its normalized form and compare the results. A result of Just True or Just False indicates that the string definitely is, or is not, in the given normalization form.

  5. package QuickCheck

    Automatic testing of Haskell programs QuickCheck is a library for random testing of program properties. The programmer provides a specification of the program, in the form of properties which functions should satisfy, and QuickCheck then tests that the properties hold in a large number of randomly generated cases. Specifications are expressed in Haskell, using combinators defined in the QuickCheck library. QuickCheck provides combinators to define properties, observe the distribution of test data, and define test data generators. You can find a (slightly out-of-date but useful) manual at http://www.cse.chalmers.se/~rjmh/QuickCheck/manual.html.

  6. module Test.QuickCheck

    For further information see the QuickCheck manual. To use QuickCheck to check a property, first define a function expressing that property (functions expressing properties under test tend to be prefixed with prop_). Testing that n + m = m + n holds for Integers one might write:

    import Test.QuickCheck
    
    prop_commutativeAdd :: Integer -> Integer -> Bool
    prop_commutativeAdd n m = n + m == m + n
    
    and testing:
    >>> quickCheck prop_commutativeAdd
    +++ OK, passed 100 tests.
    
    which tests prop_commutativeAdd on 100 random (Integer, Integer) pairs. verboseCheck can be used to see the actual values generated:
    >>> verboseCheck prop_commutativeAdd
    Passed:
    0
    0
    …98 tests omitted…
    Passed:
    -68
    6
    +++ OK, passed 100 tests.
    
    and if more than 100 tests are needed the number of tests can be increased by updating the stdArgs record:
    >>> quickCheckWith stdArgs { maxSuccess = 500 } prop_commutativeAdd
    +++ OK, passed 500 tests.
    
    To let QuickCheck generate values of your own data type an Arbitrary instance must be defined:
    data Point = MkPoint Int Int deriving Eq
    
    instance Arbitrary Point where
    arbitrary = do
    x <- arbitrary
    y <- arbitrary
    return (MkPoint x y)
    
    swapPoint :: Point -> Point
    swapPoint (MkPoint x y) = MkPoint y x
    
    -- swapPoint . swapPoint = id
    prop_swapInvolution point = swapPoint (swapPoint point) == point
    
    >>> quickCheck prop_swapInvolution
    +++ OK, passed 100 tests.
    
    See Test.QuickCheck.Function for generating random shrinkable, showable functions used for testing higher-order functions and Test.QuickCheck.Monadic for testing impure or monadic code (e.g. effectful code in IO).

  7. module Test.Hspec.QuickCheck

    No documentation available.

  8. module Test.Tasty.QuickCheck

    This module allows to use QuickCheck properties in tasty.

  9. module Test.Hspec.Core.QuickCheck

    No documentation available.

  10. module Test.Hspec.Wai.QuickCheck

    No documentation available.

Page 1 of many | Next