package monolith

  1. Overview
  2. Docs
A framework for testing a library using afl-fuzz

Install

dune-project
 Dependency

Authors

Maintainers

Sources

archive.tar.gz
md5=69c351419c24fc48f45164d7c053795b
sha512=1012f468fb3f199fe2ba8ddc8f1ec74a6bb634f5dca76b1df33cbe12e7ab627e25d48b23aa4d9d376f5185a0ea85ab35ff0e6a190a0ae125466aa26557fc21b3

doc/src/monolith/BuiltinInt.ml.html

Source file BuiltinInt.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(******************************************************************************)
(*                                                                            *)
(*                                  Monolith                                  *)
(*                                                                            *)
(*                              François Pottier                              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Lesser General Public License as published by the Free   *)
(*  Software Foundation, either version 3 of the License, or (at your         *)
(*  option) any later version, as described in the file LICENSE.              *)
(*                                                                            *)
(******************************************************************************)

open Spec

(* A concrete type: [int]. *)

(* We do not equip the type [int] with a default generator, because that
   would not make much sense; we have no idea what range is relevant.
   Thus, [int] is deconstructible, not constructible. *)

let int =
  deconstructible Print.int

(* Equipping the type [int] with a generator. *)

let int_within (generate : unit -> int) =
  ifpol
    (easily_constructible generate Print.int)
    (int)

let semi_open_interval i j =
  int_within (Gen.semi_open_interval i j)

let closed_interval i j =
  int_within (Gen.closed_interval i j)

let lt j =
  int_within (Gen.lt j)

let le j =
  int_within (Gen.le j)

let sequential () =
  int_within (Gen.sequential())
OCaml

Innovation. Community. Security.