This module exports everything that you need to be able to create your own framework test provider. To create a provider you need to:
- Create an instance of the
Testlike
class - Create an instance of the
TestResultlike
class - Expose a function that lets people construct
Test
values using your new instances
- class (Show i, Show r) => TestResultlike i r | r -> i where
- testSucceeded :: r -> Bool
- class TestResultlike i r => Testlike i r t | t -> i r, r -> i where
- runTest :: CompleteTestOptions -> t -> IO (i :~> r, IO ())
- testTypeName :: t -> TestTypeName
- type TestName = String
- type TestTypeName = String
- data Test
- = forall i r t . Testlike i r t => Test TestName t
- | TestGroup TestName [Test]
- | PlusTestOptions TestOptions Test
- testGroup :: TestName -> [Test] -> Test
- plusTestOptions :: TestOptions -> Test -> Test
- data i :~> f
- data ImprovingIO i f a
- yieldImprovement :: i -> ImprovingIO i f ()
- runImprovingIO :: ImprovingIO i f f -> IO (i :~> f, IO ())
- liftIO :: IO a -> ImprovingIO i f a
- timeoutImprovingIO :: Int -> ImprovingIO i f a -> ImprovingIO i f (Maybe a)
- maybeTimeoutImprovingIO :: Maybe Int -> ImprovingIO i f a -> ImprovingIO i f (Maybe a)
- module Test.Framework.Options
- module Test.Framework.Seed
- newtype K a = K {
- unK :: a
- secondsToMicroseconds :: Num a => a -> a
- microsecondsToPicoseconds :: Num a => a -> a
- listToMaybeLast :: [a] -> Maybe a
- mappendBy :: Monoid b => (a -> b) -> a -> a -> b
- orElse :: Maybe a -> a -> a
- onLeft :: (a -> c) -> (a, b) -> (c, b)
- onRight :: (b -> c) -> (a, b) -> (a, c)
- unlinesConcise :: [String] -> String
- mapAccumLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y])
- padRight :: Int -> String -> String
- dropLast :: Int -> [a] -> [a]
Documentation
class (Show i, Show r) => TestResultlike i r | r -> i whereSource
Something like the result of a test: works in concert with Testlike
testSucceeded :: r -> BoolSource
class TestResultlike i r => Testlike i r t | t -> i r, r -> i whereSource
Something test-like in its behaviour
runTest :: CompleteTestOptions -> t -> IO (i :~> r, IO ())Source
testTypeName :: t -> TestTypeNameSource
type TestTypeName = StringSource
The name of a type of test, such as Properties or Test Cases
Main test data type: build up a list of tests to be run with this.
forall i r t . Testlike i r t => Test TestName t | |
TestGroup TestName [Test] | |
PlusTestOptions TestOptions Test |
plusTestOptions :: TestOptions -> Test -> TestSource
data ImprovingIO i f a Source
Monad (ImprovingIO i f) | |
Functor (ImprovingIO i f) |
yieldImprovement :: i -> ImprovingIO i f ()Source
runImprovingIO :: ImprovingIO i f f -> IO (i :~> f, IO ())Source
liftIO :: IO a -> ImprovingIO i f aSource
timeoutImprovingIO :: Int -> ImprovingIO i f a -> ImprovingIO i f (Maybe a)Source
Given a number of microseconds and an improving IO action, run that improving IO action only
for at most the given period before giving up. See also timeout
.
maybeTimeoutImprovingIO :: Maybe Int -> ImprovingIO i f a -> ImprovingIO i f (Maybe a)Source
As timeoutImprovingIO
, but don't bother applying a timeout to the action if Nothing
is given
as the number of microseconds to apply the time out for.
module Test.Framework.Options
module Test.Framework.Seed
secondsToMicroseconds :: Num a => a -> aSource
microsecondsToPicoseconds :: Num a => a -> aSource
listToMaybeLast :: [a] -> Maybe aSource
unlinesConcise :: [String] -> StringSource
mapAccumLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y])Source