Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- assertBool :: HasCallStack => String -> Bool -> App ()
- assertOne :: (HasCallStack, Foldable t) => t a -> App a
- expectFailure :: HasCallStack => (AssertionFailure -> App ()) -> App a -> App ()
- shouldMatch :: (MakesValue a, MakesValue b, HasCallStack) => a -> b -> App ()
- shouldMatchWithMsg :: (MakesValue a, MakesValue b, HasCallStack) => Maybe String -> a -> b -> App ()
- data LenientMatchRule
- shouldMatchWithRules :: (MakesValue a, MakesValue b, HasCallStack) => [LenientMatchRule] -> (Value -> App (Maybe Value)) -> a -> b -> App ()
- shouldMatchBase64 :: (MakesValue a, MakesValue b, HasCallStack) => a -> b -> App ()
- shouldNotMatch :: (MakesValue a, MakesValue b, HasCallStack) => a -> b -> App ()
- shouldMatchInt :: (MakesValue a, HasCallStack) => a -> Int -> App ()
- shouldNotMatchInt :: (MakesValue a, HasCallStack) => a -> Int -> App ()
- shouldMatchRange :: (MakesValue a, HasCallStack) => a -> (Int, Int) -> App ()
- shouldMatchSet :: (MakesValue a, MakesValue b, HasCallStack) => a -> b -> App ()
- shouldBeEmpty :: (MakesValue a, HasCallStack) => a -> App ()
- shouldBeNull :: (MakesValue a, HasCallStack) => a -> App ()
- shouldMatchOneOf :: (MakesValue a, MakesValue b, HasCallStack) => a -> b -> App ()
- shouldContainString :: HasCallStack => String -> String -> App ()
- shouldContain :: (Eq a, Show a, HasCallStack) => [a] -> [a] -> App ()
- printFailureDetails :: AssertionFailure -> IO String
- printAppFailureDetails :: AppFailure -> IO String
- prettyContext :: String -> String
- printExceptionDetails :: SomeException -> IO String
- prettierCallStack :: CallStack -> IO String
- prettierCallStackLines :: CallStack -> IO String
- getSourceDir :: String -> IO (Maybe FilePath)
- type SourceDirCache = Map String (Maybe FilePath)
- getSourceDirCached :: SourceDirCache -> String -> IO (SourceDirCache, Maybe FilePath)
- tryReadFile :: FilePath -> IO (Maybe String)
- getLineNumber :: Int -> String -> Maybe String
- prettyResponse :: Response -> String
Documentation
assertBool :: HasCallStack => String -> Bool -> App () Source #
expectFailure :: HasCallStack => (AssertionFailure -> App ()) -> App a -> App () Source #
:: (MakesValue a, MakesValue b, HasCallStack) | |
=> a | The actual value |
-> b | The expected value |
-> App () |
:: (MakesValue a, MakesValue b, HasCallStack) | |
=> Maybe String | Message to be added to failure report |
-> a | The actual value |
-> b | The expected value |
-> App () |
data LenientMatchRule Source #
Instances
shouldMatchWithRules :: (MakesValue a, MakesValue b, HasCallStack) => [LenientMatchRule] -> (Value -> App (Maybe Value)) -> a -> b -> App () Source #
:: (MakesValue a, MakesValue b, HasCallStack) | |
=> a | The actual value, in base64 |
-> b | The expected value, in plain text |
-> App () |
:: (MakesValue a, MakesValue b, HasCallStack) | |
=> a | The actual value |
-> b | The un-expected value |
-> App () |
:: (MakesValue a, HasCallStack) | |
=> a | The actual value |
-> Int | The expected value |
-> App () |
Specialized variant of shouldMatch
to avoid the need for type annotations.
:: (MakesValue a, HasCallStack) | |
=> a | The actual value |
-> Int | The expected value |
-> App () |
:: (MakesValue a, HasCallStack) | |
=> a | The actual value |
-> (Int, Int) | The expected range, inclusive both sides |
-> App () |
shouldMatchSet :: (MakesValue a, MakesValue b, HasCallStack) => a -> b -> App () Source #
Match on sorted lists (sets where elements may occur more than once). (Maybe this should
be called shouldMatchMultiSet
?)
shouldBeEmpty :: (MakesValue a, HasCallStack) => a -> App () Source #
shouldBeNull :: (MakesValue a, HasCallStack) => a -> App () Source #
shouldMatchOneOf :: (MakesValue a, MakesValue b, HasCallStack) => a -> b -> App () Source #
:: HasCallStack | |
=> String | The actual value |
-> String | The expected value |
-> App () |
:: (Eq a, Show a, HasCallStack) | |
=> [a] | The actual value |
-> [a] | The expected value |
-> App () |
prettyContext :: String -> String Source #
getSourceDirCached :: SourceDirCache -> String -> IO (SourceDirCache, Maybe FilePath) Source #
prettyResponse :: Response -> String Source #