Idris2Doc : Hedgehog.Internal.Property

Hedgehog.Internal.Property

(source)

Reexports

importpublic Data.Double.Bounded

Definitions

dataTag : Type
Totality: total
Visibility: public export
Constructors:
ConfidenceTag : Tag
CoverCountTag : Tag
GroupNameTag : Tag
LabelNameTag : Tag
PropertyCountTag : Tag
PropertyNameTag : Tag
ShrinkCountTag : Tag
ShrinkLimitTag : Tag
TestCountTag : Tag
TestLimitTag : Tag
EarlyTermLowerBoundTag : Tag

Hints:
EqTag
Eqt=>Eq (Taggedtagt)
FromStringt=>FromString (Taggedtagt)
Showa=>Interpolation (Taggedta)
Monoidt=>Monoid (Taggedtagt)
Monoid (TaggedtNat)
Numt=>Num (Taggedtagt)
OrdTag
Ordt=>Ord (Taggedtagt)
Semigroupt=>Semigroup (Taggedtagt)
Semigroup (TaggedtNat)
ShowTag
Showt=>Show (Taggedtagt)
recordTagged : Tag->Type->Type
Totality: total
Visibility: public export
Constructor: 
MkTagged : t->Taggedtagt

Projection: 
.unTag : Taggedtagt->t

Hints:
Eqt=>Eq (Taggedtagt)
FromStringt=>FromString (Taggedtagt)
Showa=>Interpolation (Taggedta)
Monoidt=>Monoid (Taggedtagt)
Monoid (TaggedtNat)
Numt=>Num (Taggedtagt)
Ordt=>Ord (Taggedtagt)
Semigroupt=>Semigroup (Taggedtagt)
Semigroup (TaggedtNat)
Showt=>Show (Taggedtagt)
.unTag : Taggedtagt->t
Totality: total
Visibility: public export
unTag : Taggedtagt->t
Totality: total
Visibility: public export
0CoverCount : Type
  The total number of tests which are covered by a classifier.

Can be constructed using numeric literals.

Totality: total
Visibility: public export
0GroupName : Type
  The name of a group of properties.

Totality: total
Visibility: public export
0PropertyCount : Type
  The number of properties in a group.

Totality: total
Visibility: public export
0ShrinkCount : Type
  The numbers of times a property was able to shrink after a failing test.

Totality: total
Visibility: public export
0ShrinkLimit : Type
  The number of shrinks to try before giving up on shrinking.

Can be constructed using numeric literals:

Totality: total
Visibility: public export
0TestCount : Type
  The number of tests a property ran successfully.

Totality: total
Visibility: public export
0TestLimit : Type
  The number of successful tests that need to be run before a property test
is considered successful.

Can be constructed using numeric literals.

Totality: total
Visibility: public export
0EarlyTermLowerBound : Type
  The number of successful tests that need to be run before the first check
of a confidence interval at the early termination mode.

Can be constructed using numeric literals.

Totality: total
Visibility: public export
0PropertyName : Type
  The name of a property.

Totality: total
Visibility: public export
recordConfidence : Type
  The acceptable occurrence of false positives

Example, `the Confidence 1000000000` would mean that
you'd accept a false positive
for 1 in 10^9 tests.

Totality: total
Visibility: public export
Constructor: 
MkConfidence : (confidence : Bits64) -> (0_ : confidence>=2=True) ->Confidence

Projections:
.confidence : Confidence->Bits64
0.inBound : ({rec:0} : Confidence) ->confidence{rec:0}>=2=True

Hints:
EqConfidence
OrdConfidence
ShowConfidence
.confidence : Confidence->Bits64
Totality: total
Visibility: public export
confidence : Confidence->Bits64
Totality: total
Visibility: public export
0.inBound : ({rec:0} : Confidence) ->confidence{rec:0}>=2=True
Totality: total
Visibility: public export
0inBound : ({rec:0} : Confidence) ->confidence{rec:0}>=2=True
Totality: total
Visibility: public export
fromInteger : (n : Integer) -> {auto0_ : theBits64 (fromIntegern) >=2=True} ->Confidence
Totality: total
Visibility: public export
toProbability : Confidence->Probability
Totality: total
Visibility: export
0CoverPercentage : Type
  The relative number of tests which are covered by a classifier.

Totality: total
Visibility: public export
0LabelName : Type
  The name of a classifier.

Totality: total
Visibility: public export
recordDiff : Type
  The difference between some expected and actual value.

Totality: total
Visibility: public export
Constructor: 
MkDiff : String->String->String->String->String->ValueDiff->Diff

Projections:
.diffAdded : Diff->String
.diffInfix : Diff->String
.diffPrefix : Diff->String
.diffRemoved : Diff->String
.diffSuffix : Diff->String
.diffValue : Diff->ValueDiff

Hints:
EqDiff
ShowDiff
.diffPrefix : Diff->String
Totality: total
Visibility: public export
diffPrefix : Diff->String
Totality: total
Visibility: public export
.diffRemoved : Diff->String
Totality: total
Visibility: public export
diffRemoved : Diff->String
Totality: total
Visibility: public export
.diffInfix : Diff->String
Totality: total
Visibility: public export
diffInfix : Diff->String
Totality: total
Visibility: public export
.diffAdded : Diff->String
Totality: total
Visibility: public export
diffAdded : Diff->String
Totality: total
Visibility: public export
.diffSuffix : Diff->String
Totality: total
Visibility: public export
diffSuffix : Diff->String
Totality: total
Visibility: public export
.diffValue : Diff->ValueDiff
Totality: total
Visibility: public export
diffValue : Diff->ValueDiff
Totality: total
Visibility: public export
dataCover : Type
  Whether a test is covered by a classifier, and therefore belongs to a
'Class'.

Totality: total
Visibility: public export
Constructors:
NotCovered : Cover
Covered : Cover

Hints:
EqCover
MonoidCover
OrdCover
SemigroupCover
ShowCover
toCoverCount : Cover->CoverCount
Totality: total
Visibility: public export
recordLabel : Type->Type
  The extent to which a test is covered by a classifier.

When a classifier's coverage does not exceed the required minimum, the
test will be failed.

Totality: total
Visibility: public export
Constructor: 
MkLabel : LabelName->CoverPercentage->a->Labela

Projections:
.labelAnnotation : Labela->a
.labelMinimum : Labela->CoverPercentage
.labelName : Labela->LabelName

Hints:
Eqa=>Eq (Labela)
FoldableLabel
FunctorLabel
Semigroupa=>Semigroup (Labela)
Showa=>Show (Labela)
TraversableLabel
.labelName : Labela->LabelName
Totality: total
Visibility: public export
labelName : Labela->LabelName
Totality: total
Visibility: public export
.labelMinimum : Labela->CoverPercentage
Totality: total
Visibility: public export
labelMinimum : Labela->CoverPercentage
Totality: total
Visibility: public export
.labelAnnotation : Labela->a
Totality: total
Visibility: public export
labelAnnotation : Labela->a
Totality: total
Visibility: public export
dataLog : Type
  Log messages which are recorded during a test run.

Totality: total
Visibility: public export
Constructors:
Annotation : Lazy String->Log
Footnote : Lazy String->Log
LogLabel : LabelCover->Log

Hints:
EqLog
ShowLog
recordJournal : Type
  A record containing the details of a test run.

Totality: total
Visibility: public export
Constructor: 
MkJournal : List (Lazy Log) ->Journal

Projection: 
.journalLogs : Journal->List (Lazy Log)

Hints:
EqJournal
MonoidJournal
SemigroupJournal
ShowJournal
.journalLogs : Journal->List (Lazy Log)
Totality: total
Visibility: public export
journalLogs : Journal->List (Lazy Log)
Totality: total
Visibility: public export
recordFailure : Type
  Details on where and why a test failed.

Totality: total
Visibility: public export
Constructor: 
MkFailure : String->MaybeDiff->Failure

Projections:
.diff : Failure->MaybeDiff
.message : Failure->String

Hints:
EqFailure
ShowFailure
.message : Failure->String
Totality: total
Visibility: public export
message : Failure->String
Totality: total
Visibility: public export
.diff : Failure->MaybeDiff
Totality: total
Visibility: public export
diff : Failure->MaybeDiff
Totality: total
Visibility: public export
recordCoverage : Type->Type
  The extent to which all classifiers cover a test.

When a given classification's coverage does not exceed the required/
minimum, the test will be failed.

Totality: total
Visibility: export
Constructor: 
MkCoverage : List (LabelName, Labela) ->Coveragea

Projection: 
.coverageLabels : Coveragea->List (LabelName, Labela)

Hints:
Eqa=>Eq (Coveragea)
FoldableCoverage
FunctorCoverage
Semigroupa=>Monoid (Coveragea)
Semigroupa=>Semigroup (Coveragea)
Showa=>Show (Coveragea)
TraversableCoverage
names : Coveragea->ListLabelName
Totality: total
Visibility: export
labels : Coveragea->List (Labela)
Totality: total
Visibility: export
annotations : Coveragea->Lista
Totality: total
Visibility: export
dataTerminationCriteria : Type
Totality: total
Visibility: public export
Constructors:
EarlyTermination : Confidence->TestLimit->EarlyTermLowerBound->TerminationCriteria
NoEarlyTermination : Confidence->TestLimit->TerminationCriteria
NoConfidenceTermination : TestLimit->TerminationCriteria

Hints:
EqTerminationCriteria
ShowTerminationCriteria
unCriteria : TerminationCriteria-> (MaybeConfidence, (TestLimit, Size))
  Returns main paramters of the termination criteria

Returned size is the minimal starting size according to the criteria.
For confidence-checking criteria it is important to start with maximal size
to achieve correct distribution.

Totality: total
Visibility: public export
recordPropertyConfig : Type
  Configuration for a property test.

Totality: total
Visibility: public export
Constructor: 
MkPropertyConfig : ShrinkLimit->TerminationCriteria->PropertyConfig

Projections:
.shrinkLimit : PropertyConfig->ShrinkLimit
.terminationCriteria : PropertyConfig->TerminationCriteria

Hints:
EqPropertyConfig
ShowPropertyConfig
.shrinkLimit : PropertyConfig->ShrinkLimit
Totality: total
Visibility: public export
shrinkLimit : PropertyConfig->ShrinkLimit
Totality: total
Visibility: public export
.terminationCriteria : PropertyConfig->TerminationCriteria
Totality: total
Visibility: public export
terminationCriteria : PropertyConfig->TerminationCriteria
Totality: total
Visibility: public export
defaultMinTests : TestLimit
  The minimum amount of tests to run for a 'Property'

Totality: total
Visibility: public export
defaultLowerBound : EarlyTermLowerBound
Totality: total
Visibility: public export
defaultConfidence : Confidence
  The default confidence allows one false positive in 10^9 tests

Totality: total
Visibility: public export
defaultConfig : PropertyConfig
  The default configuration for a property test.

Totality: total
Visibility: public export
0TestT : (Type->Type) ->Type->Type
  A test monad transformer allows the assertion of expectations.

Totality: total
Visibility: public export
0Test : Type->Type
Totality: total
Visibility: public export
mkTestT : Functorm=>m (EitherFailurea, Journal) ->TestTma
Totality: total
Visibility: export
mkTest : (EitherFailurea, Journal) ->Testa
Totality: total
Visibility: export
runTestT : TestTma->m (EitherFailurea, Journal)
Totality: total
Visibility: export
runTest : Testa-> (EitherFailurea, Journal)
Totality: total
Visibility: export
writeLog : Applicativem=> Lazy Log->TestTm ()
  Log some information which might be relevant to a potential test failure.

Totality: total
Visibility: export
failWith : Applicativem=>MaybeDiff->String->TestTma
  Fail the test with an error message, useful for building other failure
combinators.

Totality: total
Visibility: export
annotate : Applicativem=> Lazy String->TestTm ()
  Annotates the source code with a message that might be useful for
debugging a test failure.

Totality: total
Visibility: export
annotateShow : Showa=>Applicativem=>a->TestTm ()
  Annotates the source code with a value that might be useful for
debugging a test failure.

Totality: total
Visibility: export
annotateAllShow : AllShowts=>Monadm=>HListts->TestTm ()
  Annotates the source code with all values separately.

Totality: total
Visibility: export
footnote : Applicativem=> Lazy String->TestTm ()
  Logs a message to be displayed as additional information in the footer of
the failure report.

Totality: total
Visibility: export
footnoteShow : Showa=>Applicativem=>a->TestTm ()
  Logs a value to be displayed as additional information in the footer of
the failure report.

Totality: total
Visibility: export
failDiff : Showa=>Showb=>Applicativem=>a->b->TestTm ()
  Fails with an error that shows the difference between two values.

Totality: total
Visibility: export
failure : Applicativem=>TestTma
  Causes a test to fail.

Totality: total
Visibility: export
success : Monadm=>TestTm ()
  Another name for `pure ()`.

Totality: total
Visibility: export
assert : Monadm=>Bool->TestTm ()
  Fails the test if the condition provided is 'False'.

Totality: total
Visibility: export
diff : Showa=>Showb=>Monadm=>a-> (a->b->Bool) ->b->TestTm ()
  Fails the test and shows a git-like diff if the comparison operation
evaluates to 'False' when applied to its arguments.

The comparison function is the second argument, which may be
counter-intuitive to Haskell programmers. However, it allows operators to
be written infix for easy reading:

This function behaves like the unix @diff@ tool, which gives a 0 exit
code if the compared files are identical, or a 1 exit code code
otherwise. Like unix @diff@, if the arguments fail the comparison, a
/diff is shown.

Totality: total
Visibility: export
(===) : Eqa=>Showa=>Monadm=>a->a->TestTm ()
  Fails the test if the two arguments provided are not equal.

Totality: total
Visibility: export
Fixity Declarations:
infix operator, level 6
infix operator, level 6
(/==) : Eqa=>Showa=>Monadm=>a->a->TestTm ()
  Fails the test if the two arguments provided are equal.

Totality: total
Visibility: export
Fixity Declaration: infix operator, level 4
evalEither : Showx=>Monadm=>Eitherxa->TestTma
  Fails the test if the 'Either' is 'Left', otherwise returns the value in
the 'Right'.

Totality: total
Visibility: export
evalMaybe : Monadm=>Maybea->TestTma
  Fails the test if the 'Maybe' is 'Nothing', otherwise returns the value in
the 'Just'.

Totality: total
Visibility: export
0PropertyT : Type->Type
  The property monad allows both the generation of test inputs
and the assertion of expectations.

Totality: total
Visibility: public export
forAllWith : (a->String) ->Gena->PropertyTa
  Generates a random input for the test by running the provided generator.

This is a the same as 'forAll' but allows the user to provide a custom
rendering function. This is useful for values which don't have a
'Show' instance.

Totality: total
Visibility: export
forAll : Showa=>Gena->PropertyTa
  Generates a random input for the test by running the provided generator.

Totality: total
Visibility: export
forAlls : AllShowts=>AllGents->PropertyT (HListts)
  Generates a random input provided a bunch of generators.

This function is an easy way to write several foralls in a row.
`[a, b, c] <- forAlls [x, y, z]` prints error message like
`(a, b, c) <- [| (forAll x, forAll y, forAll z) |]` but shrinks like
`(a, b, c) <- forAll [| (x, y, z) |]`.

Totality: total
Visibility: export
test : Testa->PropertyTa
  Lift a test in to a property.

Totality: total
Visibility: export
recordProperty : Type
  A property test, along with some configurable limits like how many times
to run the test.

Totality: total
Visibility: public export
Constructor: 
MkProperty : PropertyConfig->PropertyT () ->Property

Projections:
.config : Property->PropertyConfig
.test : Property->PropertyT ()
.config : Property->PropertyConfig
Totality: total
Visibility: public export
config : Property->PropertyConfig
Totality: total
Visibility: public export
.test : Property->PropertyT ()
Totality: total
Visibility: public export
test : Property->PropertyT ()
Totality: total
Visibility: public export
mapConfig : (PropertyConfig->PropertyConfig) ->Property->Property
  Map a config modification function over a property.

Totality: total
Visibility: export
verifiedTermination : {defaultdefaultLowerBound_ : EarlyTermLowerBound} ->Property->Property
Totality: total
Visibility: export
noVerifiedTermination : Property->Property
Totality: total
Visibility: export
mapTests : (TestLimit->TestLimit) ->Property->Property
  Adjust the number of times a property should be executed before it is considered
successful.

Totality: total
Visibility: export
withTests : TestLimit->Property->Property
  Set the number of times a property should be executed before it is considered
successful.

If you have a test that does not involve any generators and thus does not
need to run repeatedly, you can use @withTests 1@ to define a property that
will only be checked once.

Totality: total
Visibility: export
withShrinks : ShrinkLimit->Property->Property
  Set the number of times a property is allowed to shrink before the test
runner gives up and prints the counterexample.

Totality: total
Visibility: export
withConfidence : Confidence->Property->Property
  Make sure that the result is statistically significant in accordance to
the passed 'Confidence'

Totality: total
Visibility: export
property : PropertyT () ->Property
  Creates a property with the default configuration.

Totality: total
Visibility: export
property1 : PropertyT () ->Property
  Creates a property, that is tested exactly once.

Use this for tests that are not based on randomly generated
inputs.

This is an alias for `withTests 1 . property`.

Totality: total
Visibility: export
recordGroup : Type
  A named collection of property tests.

Totality: total
Visibility: public export
Constructor: 
MkGroup : GroupName->List (PropertyName, Property) ->Group

Projections:
.name : Group->GroupName
.properties : Group->List (PropertyName, Property)
.name : Group->GroupName
Totality: total
Visibility: public export
name : Group->GroupName
Totality: total
Visibility: public export
.properties : Group->List (PropertyName, Property)
Totality: total
Visibility: public export
properties : Group->List (PropertyName, Property)
Totality: total
Visibility: public export
mapProperty : (Property->Property) ->Group->Group
Totality: total
Visibility: export
mapConfig : (PropertyConfig->PropertyConfig) ->Group->Group
  Map a config modification function over all
properties in a `Group`.

Totality: total
Visibility: export
withTests : TestLimit->Group->Group
  Set the number of times the properties in a `Group`
should be executed before they are considered
successful.

Totality: total
Visibility: export
withShrinks : ShrinkLimit->Group->Group
  Set the number of times the properties in a `Group`
are allowed to shrink before the test
runner gives up and prints the counterexample.

Totality: total
Visibility: export
withConfidence : Confidence->Group->Group
  Make sure that the results of a `Group` are statistically
significant in accordance to the passed 'Confidence'

Totality: total
Visibility: export
coverPercentage : TestCount->CoverCount->CoverPercentage
Totality: total
Visibility: export
labelCovered : TestCount->LabelCoverCount->Bool
Totality: total
Visibility: export
coverageFailures : TestCount->CoverageCoverCount->List (LabelCoverCount)
Totality: total
Visibility: export
coverageSuccess : TestCount->CoverageCoverCount->Bool
  All labels are covered

Totality: total
Visibility: export
cover : Monadm=>CoverPercentage->LabelName->Bool->TestTm ()
  Require a certain percentage of the tests to be covered by the
classifier.

```idris
prop_with_coverage : Property
prop_with_coverage =
property $ do
match <- forAll Gen.bool
cover 30 "True" $ match
cover 30 "False" $ not match
```

The example above requires a minimum of 30% coverage for both
classifiers. If these requirements are not met, it will fail the test.

Totality: total
Visibility: export
classify : Monadm=>LabelName->Bool->TestTm ()
  Records the proportion of tests which satisfy a given condition.

```idris example
prop_with_classifier : Property
prop_with_classifier =
property $ do
xs <- forAll $ Gen.list (Range.linear 0 100) Gen.alpha
for_ xs $ \\x -> do
classify "newborns" $ x == 0
classify "children" $ x > 0 && x < 13
classify "teens" $ x > 12 && x < 20
```

Totality: total
Visibility: export
label : Monadm=>LabelName->TestTm ()
  Add a label for each test run. It produces a table showing the percentage
of test runs that produced each label.

Totality: total
Visibility: export
collect : Showa=>Monadm=>a->TestTm ()
  Like 'label', but uses 'Show' to render its argument for display.

Totality: total
Visibility: export
journalCoverage : Journal->CoverageCoverCount
Totality: total
Visibility: export
confidenceSuccess : TestCount->Confidence->CoverageCoverCount->Bool
  Is true when the test coverage satisfies the specified 'Confidence'
contstraint for all 'Coverage CoverCount's

Totality: total
Visibility: export
confidenceFailure : TestCount->Confidence->CoverageCoverCount->Bool
  Is true when there exists a label that is sure to have failed according to
the 'Confidence' constraint

Totality: total
Visibility: export
multOf100 : TestCount->Bool
Totality: total
Visibility: export
failureVerified : TestCount->CoverageCoverCount->MaybeConfidence->Bool
Totality: total
Visibility: export
successVerified : TestCount->CoverageCoverCount->MaybeConfidence->Bool
Totality: total
Visibility: export
abortEarly : TerminationCriteria->TestCount->CoverageCoverCount->MaybeConfidence->Bool
Totality: total
Visibility: export