penny-lib-0.8.0.0: Extensible double-entry accounting system - library

Safe HaskellNone

Penny.Steel.TestTree

Synopsis

Documentation

data TestTree a Source

A tree of tests. On evaluation of the tree, the name is not shown for tests (it is only shown for groups.) However, the name is used when the tree is displayed statically, without evaluation.

Constructors

TestTree Name (Payload a) 

data Payload a Source

Constructors

Group [TestTree a] 
Test (TestFunc a) 

data Verbosity Source

Constructors

Silent

Show nothing at all

PassFail

Show only whether the test passed or failed

FalseSubjects

Show subjects that are False

TrueSubjects

Show subjects that are True. (This is cumulative, so False subjects are shown too.)

DiscardedSubjects 
DiscardedPredicates

Show discarded results

showSubject :: (a -> Text) -> Verbosity -> IndentAmt -> Level -> Pdct a -> (a, Maybe Bool) -> [Chunk]Source

Determines whether to show a subject, and shows it.

isSubjectAndDiscardsShown :: Verbosity -> Maybe Bool -> (Bool, Bool)Source

Given a Verbosity and a Maybe Boolean indicating whether a subject is True, False, or a discard, returns whether to show the subject and whether to show the discards contained within the subject.

eachSubjectMustBeTrue :: Name -> (a -> Text) -> Pdct a -> TestTree aSource

Passes if every subject is True.

seriesAtLeastN :: Name -> (a -> Text) -> Int -> Pdct a -> TestTree aSource

Passes if at least n subjects are True.

showTestTree :: IndentAmt -> Level -> TestTree a -> [Chunk]Source

Shows a tree, without evaluating it.