package alcotest
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ec95a43fef36fab13677b0eaeea6e265294af2038664e821c2a4bbfbc0fcb43c
md5=be7b09ce3d53afa11f0ce95e78d72909
Description
Alcotest exposes simple interface to perform unit tests. It exposes
a simple TESTABLE
module type, a check
function to assert test
predicates and a run
function to perform a list of unit -> unit
test callbacks.
Alcotest provides a quiet and colorful output where only faulty runs are fully displayed at the end of the run (with the full logs ready to inspect), with a simple (yet expressive) query language to select the tests to run.
Published: 10 Nov 2016
README
Alcotest is a lightweight and colourful test framework.
Alcotest exposes simple interface to perform unit tests. It exposes a simple TESTABLE
module type, a check
function to assert test predicates and a run
function to perform a list of unit -> unit
test callbacks.
Alcotest provides a quiet and colorful output where only faulty runs are fully displayed at the end of the run (with the full logs ready to inspect), with a simple (yet expressive) query language to select the tests to run.
Examples
A simple example:
(* Build with `ocamlbuild -pkg alcotest simple.byte` *)
(* A module with functions to test *)
module To_test = struct
let capit letter = Char.uppercase letter
let plus int_list = List.fold_left (fun a b -> a + b) 0 int_list
end
(* The tests *)
let capit () =
Alcotest.(check char) "same chars" 'A' (To_test.capit 'a')
let plus () =
Alcotest.(check int) "same ints" 7 (To_test.plus [1;1;2;3])
let test_set = [
"Capitalize" , `Quick, capit;
"Add entries", `Slow , plus ;
]
(* Run it *)
let () =
Alcotest.run "My first test" [
"test_set", test_set;
]
The result is a self-contained binary which displays the test results. Use ./simple.byte --help
to see the runtime options.
$ ./simple.native
[OK] test_set 0 Capitalize.
[OK] test_set 1 Add entries.
Test Successful in 0.001s. 2 tests run.
See the examples folder for more examples.
Dependencies (8)
Dev Dependencies
None
- ahrocksdb
-
albatross
>= "1.5.0"
- ambient-context
- ambient-context-eio
-
angstrom
< "0.7.0"
-
ansi
>= "0.6.0"
- anycache
- anycache-async
- anycache-lwt
-
archetype
>= "1.4.2"
- archi
- arp
- arp-mirage
- arrakis
- art
-
asli
>= "0.2.0"
-
asn1-combinators
>= "0.2.2" & < "0.3.0"
-
atd
>= "2.3.3"
-
atdgen
>= "2.10.0"
- atdpy
- atdts
- base32
-
base64
>= "2.1.2"
-
bechamel
>= "0.5.0"
- bigarray-overlap
-
bigstring
>= "0.3"
-
bigstring-unix
>= "0.3"
- bigstringaf
- bitlib
- blake2
- bloomf
-
bls12-381
< "0.4.1" | >= "3.0.0" & < "18.0"
- bls12-381-hash
-
bls12-381-js
>= "0.4.2"
-
bls12-381-js-gen
>= "0.4.2"
- bls12-381-legacy
- bls12-381-signature
- bls12-381-unix
- blurhash
-
builder-web
< "0.2.0"
- bulletml
- bytebuffer
- ca-certs
- ca-certs-nss
- cactus
-
calendar
>= "3.0.0"
- callipyge
- camlix
- camlkit
- camlkit-base
-
capnp-rpc
< "0.6.0"
-
capnp-rpc-lwt
< "0.3"
- carray
- carton
- cborl
-
ccss
>= "1.6"
- cf-lwt
- chacha
- channel
- charrua-client
- charrua-client-lwt
-
charrua-client-mirage
< "0.11.0"
-
checkseum
>= "0.0.3"
- cid
- clarity-lang
- class_group_vdf
-
cohttp
>= "0.17.0"
- cohttp-curl-async
- cohttp-curl-lwt
-
cohttp-eio
>= "6.0.0~beta2"
- colombe
- color
-
conan
< "0.0.3"
-
conan-cli
< "0.0.3"
-
conan-database
< "0.0.3"
-
conan-lwt
< "0.0.3"
-
conan-unix
< "0.0.3"
-
conduit
= "3.0.0"
-
conex
< "0.10.0"
- conex-mirage-crypto
- conex-nocrypto
- cookie
-
cow
>= "2.2.0" & < "2.5.0"
- css
- css-parser
-
cstruct
>= "3.3.0"
- cstruct-sexp
- ctypes-zarith
- cuid
- curly
- current_incr
-
data-encoding
< "1.0.0"
-
datakit
>= "0.9.0" & < "0.12.0"
-
datakit-bridge-github
>= "0.11.0"
- datakit-ci
-
datakit-client-git
!= "0.12.0"
-
decompress
>= "0.8" & < "1.5.3"
- depyt
-
digestif
< "0.2" | >= "0.7"
-
dispatch
>= "0.4.1"
- dkim
- dkim-bin
- dkim-mirage
-
dns
>= "4.0.0"
- dns-cli
-
dns-client
>= "4.6.0"
-
dns-forward
< "0.9.0"
- dns-forward-lwt-unix
- dns-resolver
- dns-server
- dns-tsig
- dnssd
- dnssec
-
docfd
>= "2.2.0"
-
dog
< "0.2.1"
- domain-name
-
dot-merlin-reader
>= "5.3~5.3preview"
- dream
- dream-pure
- duff
-
dune-release
>= "1.0.0"
-
duration
< "0.1.1"
- emile
- encore
-
eqaf
>= "0.5"
- equinoxe
- equinoxe-cohttp
- equinoxe-hlc
- eris
- eris-lwt
-
ezjsonm
>= "0.4.2" & < "1.3.0"
-
ezjsonm-lwt
< "1.3.0"
- FPauth
- FPauth-core
- FPauth-responses
- FPauth-strategies
- faraday
- farfadet
-
fat-filesystem
>= "0.12.0"
- ff
- ff-pbt
- fiat-p256
- flex-array
- fsevents-lwt
-
functoria
>= "2.2.0"
-
functoria-runtime
>= "2.2.0" & != "3.0.1" & < "4.0.0~beta1"
- geojson
-
geoml
>= "0.1.1"
-
git
= "1.4.10" | = "1.5.0" | >= "1.5.2" & != "1.10.0" & < "2.0.0"
-
git-mirage
< "2.0.0"
- git-split
-
git-unix
>= "1.10.0" & < "2.0.0"
- git_split
- gitlab-unix
- glicko2
-
gmap
>= "0.3.0"
- gpt
- graphql
- graphql-async
-
graphql-cohttp
>= "0.13.0"
- graphql-lwt
-
graphql_parser
< "0.9.0"
-
graphql_ppx
>= "0.7.1"
- h1_parser
- h2
- hacl_func
-
hacl_x25519
>= "0.2.0"
- highlexer
- hkdf
- hockmd
- html_of_jsx
- http
-
http-multipart-formdata
< "2.0.0"
-
httpaf
>= "0.2.0"
- httpun
- httpun-ws
- hvsock
- icalendar
-
imagelib
>= "20200929"
- index
-
inferno
>= "20220603"
- influxdb-async
- influxdb-lwt
-
inquire
< "0.2.0"
- interval-map
- iomux
-
irmin
< "0.8.0" | >= "0.9.6" & != "0.11.1" & < "1.2.0" | >= "2.0.0" & < "2.3.0"
-
irmin-bench
>= "2.7.0"
-
irmin-chunk
< "2.0.0" | >= "2.3.0"
- irmin-cli
- irmin-containers
-
irmin-fs
< "2.0.0" | >= "2.3.0"
-
irmin-git
< "2.0.0" | >= "2.3.0"
-
irmin-http
< "2.0.0"
-
irmin-mem
< "2.0.0"
-
irmin-pack
>= "2.4.0" & != "2.6.1"
- irmin-pack-tools
- irmin-tezos
- irmin-tezos-utils
-
irmin-unix
>= "1.0.0" & < "2.0.0" | >= "2.4.0" & != "2.6.1"
- irmin-watcher
- jekyll-format
- jerboa
- jitsu
- jose
-
json-data-encoding
>= "0.9"
- json_decoder
- jsonxt
-
junit_alcotest
>= "2.0.2"
- jwto
-
ke
>= "0.2"
- kkmarkdown
- lambda-runtime
-
lambdapi
>= "2.0.0"
-
lambdoc
>= "1.0-beta4"
-
ledgerwallet-tezos
>= "0.2.1" & < "0.4.0"
-
lmdb
>= "1.0"
- logical
-
logtk
>= "1.5.1"
- lp
- lp-glpk
- lp-glpk-js
- lp-gurobi
- lru
- lt-code
-
mbr-format
>= "1.0.0"
-
mdx
>= "1.6.0"
- mec
-
mechaml
< "1.0.0"
-
merge-queues
>= "0.2.0"
-
merge-ropes
>= "0.2.0"
-
merlin
>= "4.17.1-414" & < "5.0-502" | >= "5.2.1-502"
-
merlin-lib
>= "4.17.1-414" & < "5.0-502" | >= "5.2.1-502"
- metrics
-
mirage
>= "4.0.0~beta1"
-
mirage-block-partition
< "0.2.0"
-
mirage-block-ramdisk
>= "0.3"
-
mirage-channel
>= "4.0.0"
- mirage-channel-lwt
-
mirage-crypto-ec
< "0.11.0"
-
mirage-flow
>= "1.0.2" & < "1.2.0"
- mirage-flow-unix
- mirage-fs-mem
-
mirage-fs-unix
>= "1.2.0"
-
mirage-kv
>= "2.0.0" & < "6.1.0"
- mirage-kv-mem
-
mirage-kv-unix
< "3.0.0"
-
mirage-logs
>= "0.3.0"
- mirage-nat
- mirage-net-fd
- mirage-net-flow
-
mirage-net-unix
>= "2.3.0"
-
mirage-runtime
>= "4.0.0~beta1" & < "4.5.0"
- mirage-tc
- mjson
- mnd
- monocypher
- mrmime
- mrt-format
- multibase
- multihash
- multihash-digestif
- multipart-form-data
- multipart_form
- multipart_form-eio
- multipart_form-lwt
- named-pipe
- nanoid
-
nbd
>= "4.0.3"
- nbd-tool
- nloge
- nocoiner
- non_empty_list
-
OCADml
>= "0.6.0"
- obatcher
-
ocaml-index
>= "1.1"
-
ocaml-r
>= "0.5.0"
-
ocaml-version
>= "3.1.0"
-
ocamlformat
>= "0.13.0" & != "0.19.0~4.13preview" & < "0.25.1"
-
ocamlformat-rpc
< "removed"
- ocamline
- ohex
- oidc
- opam-0install
-
opam-0install-cudf
>= "0.5.0"
-
opam-file-format
>= "2.1.1"
-
opentelemetry
>= "0.6"
-
opentelemetry-client-cohttp-lwt
>= "0.6"
-
opentelemetry-client-ocurl
>= "0.6"
-
opentelemetry-cohttp-lwt
>= "0.6"
-
opentelemetry-lwt
>= "0.6"
-
opium
>= "0.15.0"
- opium-graphql
- opium-testing
- opium_kernel
- osx-acl
- osx-attr
- osx-cf
- osx-fsevents
- osx-membership
- osx-mount
- osx-xattr
- otoggl
-
owl
>= "0.6.0" & != "0.9.0" & != "1.0.0"
-
owl-base
< "0.5.0"
-
owl-ode
>= "0.1.0" & != "0.2.0"
- owl-symbolic
- passmaker
- patch
-
pbkdf
< "0.3.0"
-
pecu
>= "0.2"
- pf-qubes
-
pg_query
>= "0.9.6"
- phylogenetics
- piaf
- polyglot
- polynomial
-
ppx_blob
>= "0.3.0"
- ppx_deriving_cmdliner
- ppx_deriving_rpc
- ppx_deriving_yaml
- ppx_graphql
- ppx_subliner
- ppx_units
-
ppx_yojson
>= "1.1.0"
- pratter
- prc
- preface
- pretty_expressive
- prettym
- proc-smaps
-
producer
< "0.2.0"
-
prometheus
< "1.2"
- prometheus-app
- protocell
-
protocol-9p
>= "0.3" & < "0.11.0" | >= "0.11.2"
- protocol-9p-unix
- psq
-
qcheck
>= "0.18" & < "0.22"
- quickjs
- radis
- randii
- reason-standard
- red-black-tree
-
reparse
>= "2.0.0" & < "3.0.0"
-
reparse-unix
< "2.1.0"
-
resp
< "0.10.0"
- resp-unix
-
rfc1951
< "1.0.0"
-
routes
< "2.0.0"
-
rpc
>= "5.9.0"
- rpclib
- rpclib-async
- rpclib-lwt
-
rpmfile
< "0.3.0"
- rpmfile-eio
- rpmfile-unix
- rubytt
-
SZXX
>= "4.0.0"
- salsa20
- salsa20-core
-
sanddb
>= "0.2"
-
scaml
>= "1.5.0"
- scrypt-kdf
- secp256k1-internal
-
semver
>= "0.2.1"
- sendmail
- sendmail-lwt
- sendmail-miou-unix
- sendmail-mirage
- sendmsg
- server-reason-react
- session-cookie
- session-cookie-async
- session-cookie-lwt
- sherlodoc
- slug
- sodium-fmt
-
spin
>= "0.6.0"
- squirrel
- ssh-agent
-
ssl
>= "0.6.0"
- stramon-lib
- styled-ppx
-
tcpip
>= "2.4.2" & < "4.0.0" | = "5.0.1"
-
tdigest
< "2.1.0"
-
terminal_size
>= "0.1.1"
- terminus
- terminus-cohttp
- terminus-hlc
- terml
- textrazor
-
tezos-base-test-helpers
< "13.0"
-
tezos-client-base
< "12.0"
-
tezos-test-helpers
< "11.0"
- tftp
- timedesc
- timere
-
tls
>= "0.12.0"
- toc
- topojson
- topojsone
- transept
- type_eq
- type_id
- typebeat
-
typeid
>= "1.0.1"
-
tyre
< "0.4"
-
tyxml
>= "4.0.0"
- tyxml-jsx
-
tyxml-ppx
>= "4.3.0"
- tyxml-syntax
- ulid
- universal-portal
- unix-dirent
-
unix-errno
>= "0.3.0"
-
unix-fcntl
>= "0.3.0"
- unix-sys-resource
- unix-sys-stat
- unix-time
- unstrctrd
- uspf
- uspf-lwt
- uspf-mirage
- uspf-unix
-
utop
>= "2.13.0"
- validate
- validator
- vercel
- vpnkit
- wcwidth
- websocketaf
-
x509
>= "0.7.0"
-
xapi-rrd
>= "1.8.2"
- xapi-stdext-date
- xapi-stdext-encodings
-
xapi-stdext-std
>= "4.16.0"
-
yaml
< "3.2.0"
- yaml-sexp
-
yocaml
< "2.0.0"
-
yocaml_syndication
= "2.0.0"
-
yocaml_yaml
< "2.0.0"
-
yuscii
>= "0.2.0"
- zar
-
zed
>= "3.2.2"
-
zlist
< "0.4.0"
Conflicts
None