Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atomicptr/camelcase
A simple OCaml test framework
https://github.com/atomicptr/camelcase
ocaml ocaml-library test testing unit-testing
Last synced: about 2 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 (2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-23T17:42:30.000Z (about 2 months ago)
- Last Synced: 2024-11-23T18:27:27.756Z (about 2 months ago)
- Topics: ocaml, ocaml-library, test, testing, unit-testing
- Language: OCaml
- Homepage:
- Size: 8.79 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
```scheme
(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
```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