package CamelCase

  1. Overview
  2. Docs
A simple OCaml test framework

Install

Dune Dependency

Authors

Maintainers

Sources

v0.2.0.tar.gz
md5=334df29b3b3753c6493469ed2dada61f
sha512=7f49890441cf0b2f937984cffe4f3686c80966bd15a8e775e4dbbc5ae0a3ec893aecf8f05a8ea1641606c88161042c0c52ebd405b08b1bc160c3dd6b94a77269

Description

A simple OCaml test framework

Tags

tests test unit unit tests

Published: 10 Mar 2025

README

CamelCase

A simple OCaml test framework

Install

(package
    (name my_package)
    (depends CamelCase))

; The package is not available on OPAM yet:
(pin (package (name CamelCase)) (url "git+https://github.com/atomicptr/CamelCase"))

Usage

open CamelCase

let safeDiv a = function
  | 0 -> None
  | b -> Some a / b

let () = run [
        test "test if 2 + 2 = 4" (fun () -> IntValue.expect_equals 4 (2 + 2));
        test "test safeDiv: 2 / 0 = None" (fun () -> expect_none (safeDiv 2 0);
        test "test safeDiv: several cases" (fun () ->
            expect_some (safeDiv 10 2) >>
            IntValue.expect_equals 5 (10 / 2) >>
            expect_some (safeDiv 5 1) >>
            IntValue.expect_equals 1 (5 / 1));
    ]

License

MIT

Dependencies (3)

  1. ocamlformat
  2. dune >= "3.17"
  3. ocaml >= "4.08"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.