Crdt.Io_intf.Mock

crdt · API reference

type t = {
  mutable input : bytes;
  mutable input_pos : int;
  output : Buffer.t;
  mutable closed : bool;
}

Mock connection with input/output buffers

val create : ?input:bytes -> unit -> t

Create a mock connection with given input data

val set_input : t -> string -> unit

Set the input data for reading

val get_output : t -> string

Get all output written so far

val clear_output : t -> unit

Clear the output buffer

val run : t -> (unit -> 'a) -> 'a

Run a function with mock IO handler