module ExpectStr:sig
..end
This module extends Expect.expect
to also handle Str
regular
expression. You can use `Regexp to provide the Str.regexp
.
open Expect
open ExpectStr
let (), _ =
with_spawn "ls" [| "-alh" |]
(fun t () ->
if expect t [`Regexp (Str.regexp "\\."), true] false then
prerr_endline "'.' found")
()
val expect : Expect.t ->
?fmatches:(string -> 'a option) list ->
([< `Contains of string
| `Eof
| `Exact of string
| `Fun of string -> bool
| `Prefix of string
| `Regexp of Str.regexp
| `Suffix of string
| `Timeout ] *
'a)
list -> 'a -> 'a
Expect.expect
.