Provides a thin wrapper for the FFI bindings to libexpect contained in System.Expect.ExpectBindings.
- data ExpectType
- data ExpectCase = ExpectCase {}
- data ExpectProc = ExpectProc {}
- muteExpect :: IO ()
- unmuteExpect :: IO ()
- spawnExpect :: String -> IO ExpectProc
- expectCases :: ExpectProc -> [ExpectCase] -> IO (Maybe Int)
- expectExact :: ExpectProc -> String -> IO (Maybe Int)
- expectRegex :: ExpectProc -> String -> IO (Maybe Int)
- expectMultiple :: ExpectProc -> [String] -> ExpectType -> IO (Maybe Int)
- sendLine :: ExpectProc -> String -> IO ()
Documentation
data ExpectType Source
Denotes how a case's pattern is treated.
data ExpectCase Source
Defines a case to match against.
ExpectCase | |
|
data ExpectProc Source
Proc created by spawnExpect. Contains both the CFile pointer and a Haskell handle, so the translation needs only be done once.
ExpectProc | |
|
muteExpect :: IO ()Source
Child process does not echo output to stdout.
Child process echoes output to stdout.
:: String | The command to be processed. eg. adduser bob |
-> IO ExpectProc | Expect process. |
Spawn a new expect process, running a specified program.
:: ExpectProc | The process to expect on. |
-> [ExpectCase] | The cases to match against. |
-> IO (Maybe Int) | Nothing if there are no matches (timeout / EOF), the value field of the case that matched. |
:: ExpectProc | The process to expect on. |
-> String | The pattern. |
-> IO (Maybe Int) | See expectCases. |
Expect a single case with a type of ExpExact.
:: ExpectProc | The process to expect on. |
-> String | The pattern. |
-> IO (Maybe Int) | See expectCases. |
Expect a single case with a type of ExpExact.
:: ExpectProc | The process to expect on. |
-> [String] | The patterns. |
-> ExpectType | The type of the pattern. |
-> IO (Maybe Int) | See expectCases. |
Expect multiple cases of a given type.