hedgehog-1.5: Release with confidence.

Safe Haskell | None
Language | Haskell2010

Hedgehog.Internal.Report

Contents

- Report

Synopsis

- data Summary = Summary {
  - summaryWaiting :: !PropertyCount
  - summaryRunning :: !PropertyCount
  - summaryFailed :: !PropertyCount
  - summaryGaveUp :: !PropertyCount
  - summaryOK :: !PropertyCount
  }
- data Report a = Report {
  - reportTests :: !TestCount
  - reportDiscards :: !DiscardCount
  - reportCoverage :: !(Coverage CoverCount)
  - reportSeed :: !Seed
  - reportStatus :: !a
  }
- data Progress
  - = Running
  - | Shrinking !FailureReport
- data Result
  - = Failed !FailureReport
  - | GaveUp
  - | OK
- data FailureReport = FailureReport {
  - failureShrinks :: !ShrinkCount
  - failureShrinkPath :: !ShrinkPath
  - failureCoverage :: !(Maybe (Coverage CoverCount))
  - failureAnnotations :: ![FailedAnnotation]
  - failureLocation :: !(Maybe Span)
  - failureMessage :: !String
  - failureDiff :: !(Maybe Diff)
  - failureFootnotes :: ![String]
  }
- data FailedAnnotation = FailedAnnotation {
  - failedSpan :: !(Maybe Span)
  - failedValue :: !String
  }
- data Style
  - = StyleDefault
  - | StyleAnnotation
  - | StyleFailure
- data Markup
  - = WaitingIcon
  - | WaitingHeader
  - | RunningIcon
  - | RunningHeader
  - | ShrinkingIcon
  - | ShrinkingHeader
  - | FailedIcon
  - | FailedText
  - | GaveUpIcon
  - | GaveUpText
  - | SuccessIcon
  - | SuccessText
  - | CoverageIcon
  - | CoverageText
  - | CoverageFill
  - | DeclarationLocation
  - | StyledLineNo !Style
  - | StyledBorder !Style
  - | StyledSource !Style
  - | AnnotationGutter
  - | AnnotationValue
  - | FailureArrows
  - | FailureGutter
  - | FailureMessage
  - | DiffPrefix
  - | DiffInfix
  - | DiffSuffix
  - | DiffSame
  - | DiffRemoved
  - | DiffAdded
  - | ReproduceHeader
  - | ReproduceGutter
  - | ReproduceSource
- data Config = Config {
  - configContext :: Context
  - configPrintFailedAtLocation :: Bool
  - configPrintShrinkPath :: Bool
  - configPrintReproduceMessage :: Bool
  - configPrintPrefixIcons :: PrintPrefixIcons
  }
- defaultConfig :: Config
- data Context
  - = FullContext
  - | Context Lines
- data Lines
- data PrintPrefixIcons
  - = DisablePrefixIcons
  - | EnablePrefixIcons
- renderProgress :: MonadIO m => UseColor -> Maybe PropertyName -> Report Progress -> m String
- renderResult :: MonadIO m => UseColor -> Maybe PropertyName -> Report Result -> m String
- renderResultWith :: MonadIO m => Config -> UseColor -> Maybe PropertyName -> Report Result -> m String
- renderSummary :: MonadIO m => UseColor -> Summary -> m String
- renderDoc :: MonadIO m => UseColor -> Doc Markup -> m String
- ppProgress :: MonadIO m => Maybe PropertyName -> Report Progress -> m (Doc Markup)
- ppResult :: MonadIO m => Maybe PropertyName -> Report Result -> m (Doc Markup)
- ppResultWith :: MonadIO m => Config -> Maybe PropertyName -> Report Result -> m (Doc Markup)
- ppSummary :: MonadIO m => Summary -> m (Doc Markup)
- fromResult :: Result -> Summary
- mkFailure :: ShrinkCount -> ShrinkPath -> Maybe (Coverage CoverCount) -> Maybe Span -> String -> Maybe Diff -> [Log] -> FailureReport

# Report

data Summary Source #

A summary of all the properties executed.

Constructors

Summary |

Fields

- summaryWaiting :: !PropertyCount
- summaryRunning :: !PropertyCount
- summaryFailed :: !PropertyCount
- summaryGaveUp :: !PropertyCount
- summaryOK :: !PropertyCount

#### Instances

Instances details

Monoid Summary Source # |
Instance details Defined in Hedgehog.Internal.Report Methods mempty :: Summary Source # mappend :: Summary -> Summary -> Summary Source # mconcat :: [Summary] -> Summary Source #
Semigroup Summary Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (<>) :: Summary -> Summary -> Summary Source # sconcat :: NonEmpty Summary -> Summary Source # stimes :: Integral b => b -> Summary -> Summary Source #
Show Summary Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> Summary -> ShowS Source # show :: Summary -> String Source # showList :: [Summary] -> ShowS Source #

data Report a Source #

A report on a running or completed property test.

Constructors

Report |

Fields

- reportTests :: !TestCount
- reportDiscards :: !DiscardCount
- reportCoverage :: !(Coverage CoverCount)
- reportSeed :: !Seed
- reportStatus :: !a

#### Instances

Instances details

Functor Report Source # |
Instance details Defined in Hedgehog.Internal.Report Methods fmap :: (a -> b) -> Report a -> Report b Source # (<$) :: a -> Report b -> Report a Source #
Foldable Report Source # |

Instance details

Defined in Hedgehog.Internal.Report

Methods

fold :: Monoid m => Report m -> m Source #

foldMap :: Monoid m => (a -> m) -> Report a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Report a -> m Source #

foldr :: (a -> b -> b) -> b -> Report a -> b Source #

foldr' :: (a -> b -> b) -> b -> Report a -> b Source #

foldl :: (b -> a -> b) -> b -> Report a -> b Source #

foldl' :: (b -> a -> b) -> b -> Report a -> b Source #

foldr1 :: (a -> a -> a) -> Report a -> a Source #

foldl1 :: (a -> a -> a) -> Report a -> a Source #

toList :: Report a -> [a] Source #

null :: Report a -> Bool Source #

length :: Report a -> Int Source #

elem :: Eq a => a -> Report a -> Bool Source #

maximum :: Ord a => Report a -> a Source #

minimum :: Ord a => Report a -> a Source #

sum :: Num a => Report a -> a Source #

product :: Num a => Report a -> a Source #

Traversable Report Source # |
Instance details Defined in Hedgehog.Internal.Report Methods traverse :: Applicative f => (a -> f b) -> Report a -> f (Report b) Source # sequenceA :: Applicative f => Report (f a) -> f (Report a) Source # mapM :: Monad m => (a -> m b) -> Report a -> m (Report b) Source # sequence :: Monad m => Report (m a) -> m (Report a) Source #
Show a => Show (Report a) Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> Report a -> ShowS Source # show :: Report a -> String Source # showList :: [Report a] -> ShowS Source #

data Progress Source #

The status of a running property test.

Constructors

Running |
Shrinking !FailureReport |

#### Instances

Instances details

Show Progress Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> Progress -> ShowS Source # show :: Progress -> String Source # showList :: [Progress] -> ShowS Source #
Eq Progress Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: Progress -> Progress -> Bool Source # (/=) :: Progress -> Progress -> Bool Source #

data Result Source #

The status of a completed property test.

In the case of a failure it provides the seed used for the test, the number of shrinks, and the execution log.

Constructors

Failed !FailureReport |
GaveUp |
OK |

#### Instances

Instances details

Show Result Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> Result -> ShowS Source # show :: Result -> String Source # showList :: [Result] -> ShowS Source #
Eq Result Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: Result -> Result -> Bool Source # (/=) :: Result -> Result -> Bool Source #

data FailureReport Source #

Constructors

FailureReport |

Fields

- failureShrinks :: !ShrinkCount
- failureShrinkPath :: !ShrinkPath
- failureCoverage :: !(Maybe (Coverage CoverCount))
- failureAnnotations :: ![FailedAnnotation]
- failureLocation :: !(Maybe Span)
- failureMessage :: !String
- failureDiff :: !(Maybe Diff)
- failureFootnotes :: ![String]

#### Instances

Instances details

Show FailureReport Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> FailureReport -> ShowS Source # show :: FailureReport -> String Source # showList :: [FailureReport] -> ShowS Source #
Eq FailureReport Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: FailureReport -> FailureReport -> Bool Source # (/=) :: FailureReport -> FailureReport -> Bool Source #

data FailedAnnotation Source #

Constructors

FailedAnnotation |

Fields

- failedSpan :: !(Maybe Span)
- failedValue :: !String

#### Instances

Instances details

Show FailedAnnotation Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> FailedAnnotation -> ShowS Source # show :: FailedAnnotation -> String Source # showList :: [FailedAnnotation] -> ShowS Source #
Eq FailedAnnotation Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: FailedAnnotation -> FailedAnnotation -> Bool Source # (/=) :: FailedAnnotation -> FailedAnnotation -> Bool Source #

data Style Source #

Constructors

StyleDefault |
StyleAnnotation |
StyleFailure |

#### Instances

Instances details

Semigroup Style Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (<>) :: Style -> Style -> Style Source # sconcat :: NonEmpty Style -> Style Source # stimes :: Integral b => b -> Style -> Style Source #
Show Style Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> Style -> ShowS Source # show :: Style -> String Source # showList :: [Style] -> ShowS Source #
Eq Style Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: Style -> Style -> Bool Source # (/=) :: Style -> Style -> Bool Source #
Ord Style Source # |
Instance details Defined in Hedgehog.Internal.Report Methods compare :: Style -> Style -> Ordering Source # (<) :: Style -> Style -> Bool Source # (<=) :: Style -> Style -> Bool Source # (>) :: Style -> Style -> Bool Source # (>=) :: Style -> Style -> Bool Source # max :: Style -> Style -> Style Source # min :: Style -> Style -> Style Source #

data Markup Source #

Constructors

WaitingIcon |
WaitingHeader |
RunningIcon |
RunningHeader |
ShrinkingIcon |
ShrinkingHeader |
FailedIcon |
FailedText |
GaveUpIcon |
GaveUpText |
SuccessIcon |
SuccessText |
CoverageIcon |
CoverageText |
CoverageFill |
DeclarationLocation |
StyledLineNo !Style |
StyledBorder !Style |
StyledSource !Style |
AnnotationGutter |
AnnotationValue |
FailureArrows |
FailureGutter |
FailureMessage |
DiffPrefix |
DiffInfix |
DiffSuffix |
DiffSame |
DiffRemoved |
DiffAdded |
ReproduceHeader |
ReproduceGutter |
ReproduceSource |

#### Instances

Instances details

Show Markup Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> Markup -> ShowS Source # show :: Markup -> String Source # showList :: [Markup] -> ShowS Source #
Eq Markup Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: Markup -> Markup -> Bool Source # (/=) :: Markup -> Markup -> Bool Source #
Ord Markup Source # |
Instance details Defined in Hedgehog.Internal.Report Methods compare :: Markup -> Markup -> Ordering Source # (<) :: Markup -> Markup -> Bool Source # (<=) :: Markup -> Markup -> Bool Source # (>) :: Markup -> Markup -> Bool Source # (>=) :: Markup -> Markup -> Bool Source # max :: Markup -> Markup -> Markup Source # min :: Markup -> Markup -> Markup Source #

data Config Source #

Constructors

Config |

Fields

- configContext :: Context
- configPrintFailedAtLocation :: Bool
- configPrintShrinkPath :: Bool
- configPrintReproduceMessage :: Bool
- configPrintPrefixIcons :: PrintPrefixIcons

#### Instances

Instances details

Show Config Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> Config -> ShowS Source # show :: Config -> String Source # showList :: [Config] -> ShowS Source #
Eq Config Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: Config -> Config -> Bool Source # (/=) :: Config -> Config -> Bool Source #

defaultConfig :: Config Source #

data Context Source #

Constructors

FullContext |
Context Lines |

#### Instances

Instances details

Show Context Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> Context -> ShowS Source # show :: Context -> String Source # showList :: [Context] -> ShowS Source #
Eq Context Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: Context -> Context -> Bool Source # (/=) :: Context -> Context -> Bool Source #

data Lines Source #

#### Instances

Instances details

Num Lines Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (+) :: Lines -> Lines -> Lines Source # (-) :: Lines -> Lines -> Lines Source # (*) :: Lines -> Lines -> Lines Source # negate :: Lines -> Lines Source # abs :: Lines -> Lines Source # signum :: Lines -> Lines Source # fromInteger :: Integer -> Lines Source #
Show Lines Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> Lines -> ShowS Source # show :: Lines -> String Source # showList :: [Lines] -> ShowS Source #
Eq Lines Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: Lines -> Lines -> Bool Source # (/=) :: Lines -> Lines -> Bool Source #

data PrintPrefixIcons Source #

Whether to add icons to the start of important output lines or not.

Constructors

DisablePrefixIcons | Do not add icons to the start of important output lines.
EnablePrefixIcons | Add icons to the start of important output lines.

#### Instances

Instances details

Show PrintPrefixIcons Source # |
Instance details Defined in Hedgehog.Internal.Report Methods showsPrec :: Int -> PrintPrefixIcons -> ShowS Source # show :: PrintPrefixIcons -> String Source # showList :: [PrintPrefixIcons] -> ShowS Source #
Eq PrintPrefixIcons Source # |
Instance details Defined in Hedgehog.Internal.Report Methods (==) :: PrintPrefixIcons -> PrintPrefixIcons -> Bool Source # (/=) :: PrintPrefixIcons -> PrintPrefixIcons -> Bool Source #

renderProgress :: MonadIO m => UseColor -> Maybe PropertyName -> Report Progress -> m String Source #

renderResult :: MonadIO m => UseColor -> Maybe PropertyName -> Report Result -> m String Source #

renderResultWith :: MonadIO m => Config -> UseColor -> Maybe PropertyName -> Report Result -> m String Source #

renderSummary :: MonadIO m => UseColor -> Summary -> m String Source #

renderDoc :: MonadIO m => UseColor -> Doc Markup -> m String Source #

ppProgress :: MonadIO m => Maybe PropertyName -> Report Progress -> m (Doc Markup) Source #

ppResult :: MonadIO m => Maybe PropertyName -> Report Result -> m (Doc Markup) Source #

ppResultWith :: MonadIO m => Config -> Maybe PropertyName -> Report Result -> m (Doc Markup) Source #

ppSummary :: MonadIO m => Summary -> m (Doc Markup) Source #

fromResult :: Result -> Summary Source #

Construct a summary from a single result.

mkFailure :: ShrinkCount -> ShrinkPath -> Maybe (Coverage CoverCount) -> Maybe Span -> String -> Maybe Diff -> [Log] -> FailureReport Source #