lorentz-0.4.0: EDSL for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Lorentz.Test.Doc

Description

Testing predicates for documentation of Lorentz contracts.

Synopsis

Test predicates

testLorentzDoc :: [DocTest] Source #

Tests all properties.

Individual test predicates

testDeclaresParameter :: DocTest Source #

Check that contract documents its parameter.

testEachEntrypointIsDescribed :: DocTest Source #

It's a common issue to forget to describe an entrypoint.

testParamBuildingStepsAreFinalized :: DocTest Source #

Check that finalizeParamCallingDoc is applied to the contract as it always should.

testAllEntrypointsAreCallable :: DocTest Source #

Check that all documented entrypoints are callable.

Sometimes having such an entrypoint is fine, e.g. when you have an explicit default entrypoint deep in one arm then other arms (entire arms, not individual entrypoints within them) are uncallable unless also assigned a field annotation; for example see [doc for uncallable entrypoints] note. If this is your case, exclude this test suite with excludeDocTest. But such situations are rare.

More often, this test failure indicates that entrypoints are documented incorrectly, e.g. caseT is used in some place instead of entryCase. Check whether printed building steps are correct.

NB: another, simplified example of case when disabling this test is justified:

data SubParam1 = Do1 | Default
data SubParam2 = Do2 | Do3
data Param = Arm1 SubParam1 | Arm2 SubParam2
  -- ^ with entrypoints derived via EpdRecursive

In this case entire Arm1 and Arm2 are not true entrypoints, only Default and Do{1,2,3} are, but Arm1 and Arm2 will still appear in documentation as entrypoints.