File: ppx_assert_bench.ml

package info (click to toggle)
ppx-assert 0.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 136 kB
  • sloc: ml: 317; makefile: 14
file content (14 lines) | stat: -rw-r--r-- 410 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
open Ppx_compare_lib.Builtin
open Ppx_sexp_conv_lib
open Ppx_sexp_conv_lib.Conv

let () =
  Printexc.register_printer (fun exc ->
    match sexp_of_exn_opt exc with
    | None -> None
    | Some sexp -> Some (Sexp.to_string_hum ~indent:2 sexp))
;;

let%bench "test_eq" = [%test_eq: int] 0 0
let%bench "test_pred" = [%test_pred: int] (fun i -> i = 0) 0
let%bench "test_result" = [%test_result: int] ~expect:0 0