test-karya-0.0.3: Testing framework.

Safe HaskellNone
LanguageHaskell2010

EL.Test.Global

Description

Exports from EL.Test.Testing. This is meant to be imported unqualified.

Synopsis

Documentation

data ModuleMeta Source #

Constructors

ModuleMeta (IO () -> IO ()) [Tag] 

checkVal :: Show a => HasCallStack => a -> (a -> Bool) -> IO Bool Source #

Check against a function. Use like:

checkVal (f x) $ \case -> ...

equal :: (HasCallStack, Show a, Eq a) => a -> a -> IO Bool Source #

equalFmt :: (HasCallStack, Eq a, Show a) => (a -> Text) -> a -> a -> IO Bool Source #

notEqual :: (HasCallStack, Show a, Eq a) => a -> a -> IO Bool Source #

rightEqual :: (HasCallStack, Show err, Show a, Eq a) => Either err a -> a -> IO Bool Source #

equalf :: (HasCallStack, Show a, ApproxEq a) => Double -> 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.

match :: (HasCallStack, TextLike txt) => txt -> Pattern -> IO Bool Source #

throws :: (HasCallStack, Show a) => a -> Pattern -> IO Bool Source #

The given pure value should throw an exception that matches the predicate.

ioEqual :: (HasCallStack, Eq a, Show a) => IO a -> a -> IO Bool Source #

quickcheck :: (HasCallStack, Testable prop) => prop -> IO Bool Source #

Run a quickcheck property.

qcEqual :: (Show a, Eq a) => a -> a -> Property Source #

equal for quickcheck.

success :: HasCallStack => Text -> IO Bool Source #

Print a msg with a special tag indicating a passing test.

failure :: HasCallStack => Text -> IO Bool Source #

Print a msg with a special tag indicating a failing test.

pprint :: Show a => a -> IO () Source #