Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support empty property names #520

Merged
merged 1 commit into from
May 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions hedgehog/src/Hedgehog/Internal/Report.hs
Original file line number Diff line number Diff line change
Expand Up @@ -778,17 +778,19 @@ ppFailureReport context name tests discards seed (FailureReport _ shrinkPath mco
ppName :: Maybe PropertyName -> Doc a
ppName = \case
Nothing ->
"<interactive>"
"<interactive>" <> WL.space
Just "" ->
mempty
Just (PropertyName name) ->
WL.text name
WL.text name <> WL.space

ppProgress :: MonadIO m => Maybe PropertyName -> Report Progress -> m (Doc Markup)
ppProgress name (Report tests discards coverage _ status) =
case status of
Running ->
pure . WL.vsep $ [
icon RunningIcon '●' . WL.annotate RunningHeader $
ppName name <+>
ppName name <>
"passed" <+>
ppTestCount tests <>
ppWithDiscardCount discards <+>
Expand All @@ -798,7 +800,7 @@ ppProgress name (Report tests discards coverage _ status) =

Shrinking failure ->
pure . icon ShrinkingIcon '↯' . WL.annotate ShrinkingHeader $
ppName name <+>
ppName name <>
"failed" <+> ppFailedAtLocation (failureLocation failure) <#>
"after" <+>
ppTestCount tests <>
Expand All @@ -815,7 +817,7 @@ ppResultWith context name (Report tests discards coverage seed result) = do
pfailure <- ppFailureReport context name tests discards seed failure
pure . WL.vsep $ [
icon FailedIcon '✗' . WL.align . WL.annotate FailedText $
ppName name <+>
ppName name <>
"failed" <+> ppFailedAtLocation (failureLocation failure) <#>
"after" <+>
ppTestCount tests <>
Expand All @@ -830,7 +832,7 @@ ppResultWith context name (Report tests discards coverage seed result) = do
GaveUp ->
pure . WL.vsep $ [
icon GaveUpIcon '⚐' . WL.annotate GaveUpText $
ppName name <+>
ppName name <>
"gave up after" <+>
ppDiscardCount discards <>
", passed" <+>
Expand All @@ -842,7 +844,7 @@ ppResultWith context name (Report tests discards coverage seed result) = do
OK ->
pure . WL.vsep $ [
icon SuccessIcon '✓' . WL.annotate SuccessText $
ppName name <+>
ppName name <>
"passed" <+>
ppTestCount tests <>
"."
Expand Down
Loading