falsify-0.4.0: Property-based testing with internal integrated shrinking
Safe HaskellNone
LanguageHaskell2010

Test.Falsify.Context

Contents

Description

Context

Intended for qualified import.

import Test.Falsify
import Test.Falsify.Context (Context)
import qualified Test.Falsify.Context as Context
Synopsis

Context

data Context Source #

Contextual data for a single test case

Properties can access contextual data pertaining to the current test case in a test run. An example of its use is varying the range of generated values depending on how many tests we have already done, generating a smaller range in the beginning but widening the range later on.

Constructors

Context 

Instances

Instances details
Show Context Source # 
Instance details

Defined in Test.Falsify.Context

Eq Context Source # 
Instance details

Defined in Test.Falsify.Context

Methods

(==) :: Context -> Context -> Bool #

(/=) :: Context -> Context -> Bool #

data Static Source #

Static context

The part of the context that does not change between test iterations.

Constructors

Static 

Fields

Instances

Instances details
Show Static Source # 
Instance details

Defined in Test.Falsify.Context

Eq Static Source # 
Instance details

Defined in Test.Falsify.Context

Methods

(==) :: Static -> Static -> Bool #

(/=) :: Static -> Static -> Bool #

data Iteration Source #

Iteration context

Information about the current test iteration specifically.

Constructors

Iteration 

Fields

Instances

Instances details
Show Iteration Source # 
Instance details

Defined in Test.Falsify.Context

Eq Iteration Source # 
Instance details

Defined in Test.Falsify.Context

data Execution Source #

Test execution context

NOTE: This should not affect whether the test passes or fails; if it does, you will get undefined shrinking behaviour.

Constructors

Initial

Initial test execution

Shrinking Word

Shrink step

We record the index of the shrink step (0-based)

Final Word

Final test execution

We always end a test execution with one more final run, which is a repeat of the run that came just before it.

We record how many shrink steps we took in between Initial and Final; this may be zero, if the initial test happened to be minimal already or shrinking is disabled.

Instances

Instances details
Show Execution Source # 
Instance details

Defined in Test.Falsify.Context

Eq Execution Source # 
Instance details

Defined in Test.Falsify.Context