System.Expect.ExpectCombinators
- data ExpectM a = ExpectM (Maybe ExpectProc -> IO (a, Maybe ExpectProc))
- data ExpectOption a
- spawn :: String -> ExpectM ()
- send :: String -> ExpectM ()
- switch :: [ExpectOption a] -> a -> ExpectM a
- wait :: ExpectType -> String -> ExpectM ()
- check :: ExpectType -> String -> ExpectM a -> ExpectOption a
- mute :: ExpectM ()
- unmute :: ExpectM ()
- runExpect :: ExpectM a -> IO a
- runExpectIO :: ExpectM (IO a) -> IO a
Documentation
Constructors
| ExpectM (Maybe ExpectProc -> IO (a, Maybe ExpectProc)) |
data ExpectOption a Source
Spawns the child process specified, and is used for all following actions.
Send a line to the current process.
Arguments
| :: [ExpectOption a] | List of cases |
| -> a | Resulting value in case of no case matches |
| -> ExpectM a |
Take a list of cases and run the action of the case that matches, or return a fail value in the case of no matches.
Arguments
| :: ExpectType | How pattern is used. |
| -> String | Pattern |
| -> ExpectM () |
Wait for a pattern to match.
Arguments
| :: ExpectType | How to interpret the pattern |
| -> String | Pattern |
| -> ExpectM a | action to take in case that the case matches |
| -> ExpectOption a |
Construct an option for use with switch
Run an ExpectM (IO a) action, and join the result, moving it from IO (IO a) to IO a.