module ExpectPcre:sig
..end
This module extends Expect.expect
to also handle Pcre
regular
expression. You can use either `Pat or `Rex, which will be passed to
Pcre.pmatch
.
open Expect
open ExpectPcre
let (), _ =
with_spawn "ls" [| "-alh" |]
(fun t () ->
if expect t [`Pat "\\.", 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
| `Pat of string
| `Prefix of string
| `Rex of Pcre.regexp
| `Suffix of string
| `Timeout ] *
'a)
list -> 'a -> 'a
Expect.expect
.