https://github.com/atomicptr/camelcase
A simple OCaml test framework
https://github.com/atomicptr/camelcase
ocaml ocaml-library test testing unit-testing
Last synced: 4 months ago
JSON representation
A simple OCaml test framework
- Host: GitHub
- URL: https://github.com/atomicptr/camelcase
- Owner: atomicptr
- License: mit
- Created: 2024-11-19T17:05:50.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-03-11T10:17:05.000Z (4 months ago)
- Last Synced: 2025-03-15T23:14:42.770Z (4 months ago)
- Topics: ocaml, ocaml-library, test, testing, unit-testing
- Language: OCaml
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CamelCase
A simple OCaml test framework
## Install
### Opam (recommended)
Opam Url: https://opam.ocaml.org/packages/CamelCase/
```scheme
(package
(name my_package)
(depends CamelCase))
```### Pin the package in dune
```scheme
(package
(name my_package)
(depends CamelCase)); add this line to your dune-project
(pin (package (name CamelCase)) (url "git+https://github.com/atomicptr/CamelCase"))
```## Usage
```ocaml
open CamelCaselet safeDiv a = function
| 0 -> None
| b -> Some a / blet () = 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