MFlow-0.4.5.9: stateful, RESTful web framework

Safe HaskellNone

MFlow.Forms.Test

Description

 

Synopsis

Documentation

class Generate a whereSource

Methods

generate :: IO aSource

runTest :: [(Int, Flow)] -> IO ()Source

run a list of flows with a number of simultaneous threads

inject :: MonadIO m => m b -> (Int -> b) -> m bSource

inject substitutes an expression by other. It may be used to override ask interaction with the user. It should bee used infix for greater readability:

 ask something    `inject` const someother

The parameter passed is the test number if the flow has not been executed by runTest, inject return the original

ask :: (Generate a, MonadIO m, Functor m, FormInput v, Typeable v) => View v m a -> FlowM v m aSource

a simulated ask that generate simulated user input of the type expected.

It forces the web page rendering, since it is monadic and can contain side effects and load effects to be tested.

it is a substitute of ask from MFlow.Forms for testing purposes.

askt :: (MonadIO m, FormInput v) => (Int -> a) -> View v m a -> FlowM v m aSource

instead of generating a result like ask, the result is given as the first parameter so it does not need a Generate instance.

It forces the web page rendering, since it is monadic so it can contain side effects and load effects to be tested.

verify :: a -> (Bool, String) -> aSource

a pure version of verifyM