package hegel
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Hegel property-based testing library for OCaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
hegel-0.8.0-opam.tar.gz
md5=d9ec174b148ddf3a1b9b3173280adea9
sha512=d17f865aaffd61f2a07c45816e09e11443f770fc78977830fa42e134c0588062ede5cb0e9dac8e06f21b575a0b624c4e312a07e3879306abb6fbbcdc9026ebce
doc/src/hegel.test_runtime/hegel_test_runtime.ml.html
Source file hegel_test_runtime.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 46 47 48 49 50 51 52 53 54 55(** Runtime registry and runner for [let%hegel_test] tests. See the accompanying [.mli] for the public API. *) type test = { name : string ; file : string ; line : int ; run : unit -> unit } let registry : test list ref = ref [] let registry_lock = Mutex.create () let register ~name ~file ~line run = Mutex.lock registry_lock; registry := { name; file; line; run } :: !registry; Mutex.unlock registry_lock ;; let registered () = Mutex.lock registry_lock; let snapshot = List.rev !registry in Mutex.unlock registry_lock; snapshot ;; let run_all () = let tests = registered () in let failures = ref 0 in List.iter (fun t -> match t.run () with | () -> Printf.printf " PASS %s (%s:%d)\n%!" t.name t.file t.line | exception e -> incr failures; Printf.printf " FAIL %s (%s:%d)\n %s\n%!" t.name t.file t.line (Printexc.to_string e)) tests; !failures ;; let test_main () = let failures = run_all () in if failures > 0 then ( Printf.eprintf "\n%d test(s) failed\n%!" failures; Stdlib.exit 1) else ( Printf.printf "\nAll tests passed\n%!"; Stdlib.exit 0) ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>