ideas-1.1: Feedback services for intelligent tutoring systems

Portabilityportable (depends on ghc)
Stabilityprovisional
Maintainerbastiaan.heeren@ou.nl
Safe HaskellNone

Ideas.Common.Utils.TestSuite

Contents

Description

A lightweight wrapper around the QuickCheck library. It introduces the notion of a test suite, and it stores the test results for later inspection (e.g., for the generation of a test report). A test suite has a monadic interface.

Synopsis

Test Suite Monad

type TestSuite = TestSuiteM ()Source

class Monad m => MonadIO m where

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Methods

liftIO :: IO a -> m a

Lift a computation from the IO monad.

Instances

MonadIO IO 
MonadIO m => MonadIO (CGIT m) 
MonadIO m => MonadIO (ListT m) 
MonadIO m => MonadIO (MaybeT m) 
MonadIO m => MonadIO (IdentityT m) 
MonadIO m => MonadIO (ContT r m) 
(Error e, MonadIO m) => MonadIO (ErrorT e m) 
MonadIO m => MonadIO (ReaderT r m) 
MonadIO m => MonadIO (StateT s m) 
MonadIO m => MonadIO (StateT s m) 
(Monoid w, MonadIO m) => MonadIO (WriterT w m) 
(Monoid w, MonadIO m) => MonadIO (WriterT w m) 
MonadIO m => MonadIO (ParsecT s u m) 
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 

Test suite constructors

suite :: String -> TestSuite -> TestSuiteSource

Construct a (named) test suite containing tests and other suites

addProperty :: Testable prop => String -> prop -> TestSuiteSource

Add a QuickCheck property to the test suite. The first argument is a label for the property

addPropertyWith :: Testable prop => String -> Args -> prop -> TestSuiteSource

Add a QuickCheck property to the test suite, also providing a test configuration (Args)

assertEquals :: (Eq a, Show a) => String -> a -> a -> TestSuiteSource

Running a test suite

Test Suite Result

Messages

data Message Source

Instances