package expect

  1. Overview
  2. Docs
Simple implementation of 'expect' to help building unitary testing of interactive program

Install

Dune Dependency

Authors

Maintainers

Sources

expect-0.1.0.tbz
sha256=25465f78cff8ba44e85cafdff053b9a30320269c2bbb851d2b34d855d6464cc1
sha512=4f4567812afb9ef611749b5256550c05b1ec03c3910e9a3336ec4dec54156b4596acb27143c758e1ebd035398412cd21a0b90c7c4559c0ad57e91355d24a273a

doc/expect.pcre/ExpectPcre/index.html

Module ExpectPcreSource

Extend Expect module with Pcre matches.

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")
  ()
  • author Sylvain Le Gall
Sourceval expect : Expect.t -> ?fmatches:(string -> 'a option) list -> ([< Expect.expect_match | `Pat of string | `Rex of Re.Pcre.regexp ] * 'a) list -> 'a -> 'a
OCaml

Innovation. Community. Security.