Safe Haskell | None |
---|---|
Language | Haskell2010 |
Exports from EL.Test.Testing. This is meant to be imported unqualified.
Synopsis
- data ModuleMeta = ModuleMeta (IO () -> IO ()) [Tag]
- check :: HasCallStack => Text -> Bool -> IO Bool
- checkVal :: Show a => HasCallStack => a -> (a -> Bool) -> IO Bool
- equal :: (HasCallStack, Show a, Eq a) => a -> a -> IO Bool
- equalFmt :: (HasCallStack, Eq a, Show a) => (a -> Text) -> a -> a -> IO Bool
- notEqual :: (HasCallStack, Show a, Eq a) => a -> a -> IO Bool
- rightEqual :: (HasCallStack, Show err, Show a, Eq a) => Either err a -> a -> IO Bool
- equalf :: (HasCallStack, Show a, ApproxEq a) => Double -> a -> a -> IO Bool
- stringsLike :: forall txt. (HasCallStack, TextLike txt) => [txt] -> [Pattern] -> IO Bool
- leftLike :: (HasCallStack, Show a, TextLike txt) => Either txt a -> Pattern -> IO Bool
- match :: (HasCallStack, TextLike txt) => txt -> Pattern -> IO Bool
- throws :: (HasCallStack, Show a) => a -> Pattern -> IO Bool
- ioEqual :: (HasCallStack, Eq a, Show a) => IO a -> a -> IO Bool
- expectRight :: (HasCallStack, Show a) => Either a b -> b
- quickcheck :: (HasCallStack, Testable prop) => prop -> IO Bool
- qcEqual :: (Show a, Eq a) => a -> a -> Property
- success :: HasCallStack => Text -> IO Bool
- failure :: HasCallStack => Text -> IO Bool
- pprint :: Show a => a -> IO ()
Documentation
data ModuleMeta Source #
ModuleMeta (IO () -> IO ()) [Tag] |
checkVal :: Show a => HasCallStack => a -> (a -> Bool) -> IO Bool Source #
Check against a function. Use like:
checkVal (f x) $ \case -> ...
rightEqual :: (HasCallStack, Show err, Show a, Eq a) => Either err a -> a -> IO Bool Source #
stringsLike :: forall txt. (HasCallStack, TextLike txt) => [txt] -> [Pattern] -> IO Bool Source #
Strings in the first list match patterns in the second list, using
patternMatches
.
leftLike :: (HasCallStack, Show a, TextLike txt) => Either txt a -> Pattern -> IO Bool Source #
It's common for Left to be an error msg, or be something that can be converted to one.
throws :: (HasCallStack, Show a) => a -> Pattern -> IO Bool Source #
The given pure value should throw an exception that matches the predicate.
expectRight :: (HasCallStack, Show a) => Either a b -> b Source #
quickcheck :: (HasCallStack, Testable prop) => prop -> IO Bool Source #
Run a quickcheck property.
success :: HasCallStack => Text -> IO Bool Source #
Print a msg with a special tag indicating a passing test.