Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Status
- combineStatus :: Status -> Status -> Status
- data Env = Env {}
- newtype Test a = Test (ReaderT Env IO (Maybe a))
- io :: IO a -> Test a
- atomicLogger :: IO (String -> IO ())
- expect' :: HasCallStack => Bool -> Test ()
- expect :: HasCallStack => Bool -> Test ()
- expectEqual' :: (HasCallStack, Eq a, Show a) => a -> a -> Test ()
- expectEqual :: (HasCallStack, Eq a, Show a) => a -> a -> Test ()
- expectNotEqual :: (HasCallStack, Eq a, Show a) => a -> a -> Test ()
- expectJust :: HasCallStack => Maybe a -> Test a
- expectRight :: HasCallStack => Either e a -> Test a
- expectLeft :: HasCallStack => Either e a -> Test e
- tests :: [Test ()] -> Test ()
- runOnly :: String -> Test a -> IO ()
- rerunOnly :: Int -> String -> Test a -> IO ()
- run :: Test a -> IO ()
- rerun :: Int -> Test a -> IO ()
- run' :: Int -> (String -> IO ()) -> String -> Test a -> IO ()
- scope :: String -> Test a -> Test a
- note :: String -> Test ()
- note' :: Show s => s -> Test ()
- random :: Random a => Test a
- random' :: Random a => a -> a -> Test a
- bool :: Test Bool
- word8 :: Test Word8
- char :: Test Char
- int :: Test Int
- double :: Test Double
- word :: Test Word
- int' :: Int -> Int -> Test Int
- char' :: Char -> Char -> Test Char
- double' :: Double -> Double -> Test Double
- word' :: Word -> Word -> Test Word
- word8' :: Word8 -> Word8 -> Test Word8
- pick :: [a] -> Test a
- picker :: Int -> [a] -> Int -> Maybe a
- listOf :: Int -> Test a -> Test [a]
- listsOf :: [Int] -> Test a -> Test [[a]]
- pair :: Test a -> Test b -> Test (a, b)
- tuple2 :: (Random a, Random b) => Test (a, b)
- tuple3 :: (Random a, Random b, Random c) => Test (a, b, c)
- tuple4 :: (Random a, Random b, Random c, Random d) => Test (a, b, c, d)
- mapOf :: Ord k => Int -> Test k -> Test v -> Test (Map k v)
- mapsOf :: Ord k => [Int] -> Test k -> Test v -> Test [Map k v]
- wrap :: Test a -> Test a
- runWrap :: Env -> ReaderT Env IO (Maybe a) -> IO (Maybe a)
- using :: IO r -> (r -> IO ()) -> (r -> Test a) -> Test a
- currentScope :: Test String
- noteScoped :: String -> Test ()
- ok :: Test ()
- done :: Test a
- skip :: Test ()
- crash :: HasCallStack => String -> Test a
- nologging :: HasCallStack => Test a -> Test a
- attempt :: Test a -> Test (Maybe a)
- pending :: HasCallStack => Test a -> Test a
- putResult :: Status -> ReaderT Env IO ()
- fork :: Test a -> Test ()
- fork' :: Test a -> Test (Test a)
Documentation
expectEqual' :: (HasCallStack, Eq a, Show a) => a -> a -> Test () Source #
expectEqual :: (HasCallStack, Eq a, Show a) => a -> a -> Test () Source #
expectNotEqual :: (HasCallStack, Eq a, Show a) => a -> a -> Test () Source #
expectJust :: HasCallStack => Maybe a -> Test a Source #
expectRight :: HasCallStack => Either e a -> Test a Source #
expectLeft :: HasCallStack => Either e a -> Test e Source #
rerunOnly :: Int -> String -> Test a -> IO () Source #
Run all tests with the given seed and whose scope starts with the given prefix
scope :: String -> Test a -> Test a Source #
Label a test. Can be nested. A `.
` is placed between nested
scopes, so `scope "foo" . scope "bar"` is equivalent to `scope "foo.bar"`
random' :: Random a => a -> a -> Test a Source #
Generate a bounded random value. Inclusive on both sides.
listsOf :: [Int] -> Test a -> Test [[a]] Source #
Generate a list of lists of the given sizes,
an alias for `sizes forM
n -> listOf n gen`
tuple4 :: (Random a, Random b, Random c, Random d) => Test (a, b, c, d) Source #
Generate a random 4-tuple.
mapOf :: Ord k => Int -> Test k -> Test v -> Test (Map k v) Source #
Generate a `Data.Map k v` of the given size.
mapsOf :: Ord k => [Int] -> Test k -> Test v -> Test [Map k v] Source #
Generate a `[Data.Map k v]` of the given sizes.
currentScope :: Test String Source #
The current scope
noteScoped :: String -> Test () Source #
Prepend the current scope to a logging message
nologging :: HasCallStack => Test a -> Test a Source #
Overwrites the env so that note_ (the logger) is a no op
attempt :: Test a -> Test (Maybe a) Source #
Run a test under a new scope, without logs and suppressing all output