Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data Assertion m a where
- Assert' :: AssertionGroup -> AssertionSeverity -> Text -> AssertionStatus -> Assertion m ()
- newtype AssertionGroup = AssertionGroup [Text]
- prettyPrintAssertionGroup :: AssertionGroup -> Text -> Text
- newtype AssertionLog = AssertionLog [AssertionEntry]
- hasFailedAssertions :: AssertionLog -> Bool
- filterFailedAssertions :: AssertionLog -> [Text]
- isFailure :: AssertionEntry -> Bool
- shouldFailNow :: AssertionEntry -> Bool
- data AssertionEntry = AssertionEntry {}
- data AssertionStatus
- pattern FailureWithMessage :: Text -> AssertionStatus
- data AssertionSeverity
- prettyPrintAssertionEntry :: AssertionEntry -> Text
- assert' :: forall r. Member Assertion r => AssertionGroup -> AssertionSeverity -> Text -> AssertionStatus -> Sem r ()
- successIsTrue :: Bool -> AssertionStatus
- assertTrue :: Member Assertion r => Text -> Bool -> Sem r ()
- assertEquals :: (Eq a, Member Assertion r) => Text -> a -> a -> Sem r ()
- assertTrueWith :: Member Assertion r => Text -> Bool -> Text -> Sem r ()
- assertTrueWithM :: Member Assertion r => Text -> Bool -> Sem r Text -> Sem r ()
- assert :: Member Assertion r => Text -> AssertionStatus -> Sem r ()
- assertM :: Member Assertion r => Text -> Sem r AssertionStatus -> Sem r ()
- assertError :: Member Assertion r => Text -> Sem (Error Text ': r) () -> Sem r ()
- failedAssertion :: Member Assertion r => Text -> Sem r ()
- failLater :: Member Assertion r => Sem r a -> Sem r a
- warnOnly :: Member Assertion r => Sem r a -> Sem r a
- describe :: Members [Assertion, Log] r => Text -> Sem r a -> Sem r a
- describe' :: Members [Assertion, Log] r => [Text] -> Sem r a -> Sem r a
Documentation
Assertion effects so we can skip past them in dry runs, and optionally throw exceptions or just collect them along the way for final reporting, etc..
Assert' :: AssertionGroup -> AssertionSeverity -> Text -> AssertionStatus -> Assertion m () | Assertions are run-time checks based on actual results that may be returned by various operations. Dry runs may ignore these failures, but they're respected in real operations. |
Instances
ToDumpItem (b :: k) (Assertion :: (Type -> Type) -> Type -> Type) # | |
Defined in Napkin.Run.Effects.Interceptors.LogProgram | |
GShow (Assertion a :: Type -> Type) # | |
Defined in Napkin.Run.Effects.Languages.Assertion gshowsPrec :: forall (a0 :: k). Int -> Assertion a a0 -> ShowS # | |
Show (Assertion a b) # | |
Eq (Assertion a b) # | |
newtype AssertionGroup #
Instances
prettyPrintAssertionGroup :: AssertionGroup -> Text -> Text #
newtype AssertionLog #
Instances
hasFailedAssertions :: AssertionLog -> Bool #
filterFailedAssertions :: AssertionLog -> [Text] #
isFailure :: AssertionEntry -> Bool #
shouldFailNow :: AssertionEntry -> Bool #
data AssertionEntry #
Instances
Show AssertionEntry # | |
Defined in Napkin.Run.Effects.Languages.Assertion showsPrec :: Int -> AssertionEntry -> ShowS # show :: AssertionEntry -> String # showList :: [AssertionEntry] -> ShowS # | |
Eq AssertionEntry # | |
Defined in Napkin.Run.Effects.Languages.Assertion (==) :: AssertionEntry -> AssertionEntry -> Bool # (/=) :: AssertionEntry -> AssertionEntry -> Bool # |
data AssertionStatus #
Instances
pattern FailureWithMessage :: Text -> AssertionStatus #
data AssertionSeverity #
Instances
Show AssertionSeverity # | |
Defined in Napkin.Run.Effects.Languages.Assertion showsPrec :: Int -> AssertionSeverity -> ShowS # show :: AssertionSeverity -> String # showList :: [AssertionSeverity] -> ShowS # | |
Eq AssertionSeverity # | |
Defined in Napkin.Run.Effects.Languages.Assertion (==) :: AssertionSeverity -> AssertionSeverity -> Bool # (/=) :: AssertionSeverity -> AssertionSeverity -> Bool # |
assert' :: forall r. Member Assertion r => AssertionGroup -> AssertionSeverity -> Text -> AssertionStatus -> Sem r () #
Assertions are run-time checks based on actual results that may be returned by various operations. Dry runs may ignore these failures, but they're respected in real operations.
successIsTrue :: Bool -> AssertionStatus #