Safe Haskell | None |
---|
- type Pass = Bool
- type Name = Text
- data TestTree a = TestTree Name (Payload a)
- data Payload a
- type TestFunc a = IndentAmt -> PassVerbosity -> FailVerbosity -> [a] -> Level -> (Pass, [Chunk])
- group :: Name -> [TestTree a] -> TestTree a
- test :: Name -> TestFunc a -> TestTree a
- type PassVerbosity = Verbosity
- type FailVerbosity = Verbosity
- data Verbosity
- showSubject :: (a -> Text) -> Verbosity -> IndentAmt -> Level -> Pdct a -> (a, Maybe Bool) -> [Chunk]
- isSubjectAndDiscardsShown :: Verbosity -> Maybe Bool -> (Bool, Bool)
- showTestTitle :: IndentAmt -> Level -> Name -> Pass -> [Chunk]
- isTrue :: Maybe Bool -> Bool
- eachSubjectMustBeTrue :: Name -> (a -> Text) -> Pdct a -> TestTree a
- seriesAtLeastN :: Name -> (a -> Text) -> Int -> Pdct a -> TestTree a
- indent :: IndentAmt -> Level -> Text -> Chunk
- showTestTree :: IndentAmt -> Level -> TestTree a -> [Chunk]
- evalTestTree :: IndentAmt -> Level -> PassVerbosity -> FailVerbosity -> [a] -> TestTree a -> [Either Chunk (Pass, [Chunk])]
Documentation
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.
type TestFunc a = IndentAmt -> PassVerbosity -> FailVerbosity -> [a] -> Level -> (Pass, [Chunk])Source
type PassVerbosity = VerbositySource
type FailVerbosity = VerbositySource
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.
evalTestTree :: IndentAmt -> Level -> PassVerbosity -> FailVerbosity -> [a] -> TestTree a -> [Either Chunk (Pass, [Chunk])]Source