Safe Haskell | None |
---|---|
Language | Haskell98 |
- class Generate a where
- runTest :: [(Int, Flow)] -> IO ()
- runTest1 :: (Token -> Workflow IO b) -> IO (Either WFErrors b)
- inject :: MonadIO m => m b -> (Int -> b) -> m b
- ask :: (Generate a, MonadIO m, Functor m, FormInput v, Typeable v) => View v m a -> FlowM v m a
- askt :: (MonadIO m, FormInput v) => (Int -> a) -> View v m a -> FlowM v m a
- userWidget :: (MonadIO m, Functor m, FormInput view) => Maybe String -> View view m (Maybe (String, String), Maybe String) -> View view m String
- getUser :: (FormInput view, Typeable view, Functor m, MonadIO m) => Maybe String -> View view m (Maybe (String, String), Maybe String) -> FlowM view m String
- getUserSimple :: (MonadIO m, FormInput view, Typeable view, Functor m) => FlowM view m String
- verify :: a -> (Bool, String) -> a
Documentation
inject :: MonadIO m => m b -> (Int -> b) -> m b Source
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 some other
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 a Source
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 a Source
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.
userWidget :: (MonadIO m, Functor m, FormInput view) => Maybe String -> View view m (Maybe (String, String), Maybe String) -> View view m String Source
getUser :: (FormInput view, Typeable view, Functor m, MonadIO m) => Maybe String -> View view m (Maybe (String, String), Maybe String) -> FlowM view m String Source