package hedgehog

  1. Overview
  2. Docs
Property-based testing with integrated shrinking for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

hedgehog-0.1.tbz
sha256=336e7547dd1e41b3e4839a11aaec56d4e2fe14b7dc82a9caa560dbd24f2614f7
sha512=5f040fc5e41b4571b75c460622becd98c54a1d5cb36574a9d2ed6d06e71a5b31673b8ea69d9bb5972af9c71dff58fba2b9d33932a6bffc04c6dcd757583895cb

doc/hedgehog/Hedgehog/Stm/module-type-Spec/index.html

Module type Stm.SpecSource

User-provided specification of the system under test.

type cmd

The command type — typically a variant.

type state

Abstract model state.

type sut

System under test (the real implementation).

type result

Result of executing a command — a user-defined type.

val show_cmd : cmd -> string

Pretty-print a command for diagnostic output.

val show_result : result -> string

Pretty-print a result for diagnostic output.

val gen_cmd : state -> cmd Gen.t

Generate a random command given the current model state.

val shrink_cmd : cmd -> cmd Seq.t

Shrink a command to simpler alternatives.

val init_state : state

Initial model state.

val init_sut : unit -> sut

Create a fresh system under test.

val cleanup : sut -> unit

Tear down the system under test.

val next_state : cmd -> state -> state

Advance the model state after a command.

val precond : state -> cmd -> bool

Check whether a command is valid in the given state.

val run : cmd -> sut -> result

Execute a command against the real system.

val postcond : cmd -> state -> result -> bool

Check the result of a command against the model state (before the command).