Module Alcotest_extra

Extended utilities for Alcotest used in TC39 Test262 tests

module RegExp = Quickjs.RegExp
val test : string -> ('a -> Alcotest.return) -> 'a Alcotest.test_case
val assert_float : float -> float -> unit
val assert_float_exact : float -> float -> unit
val assert_int : int -> int -> unit
val assert_string : string -> string -> unit
val assert_bool : bool -> bool -> unit
val assert_nan : float -> unit
val assert_not_nan : float -> unit
val assert_infinity : float -> unit
val assert_neg_infinity : float -> unit
val assert_positive_zero : float -> unit
val assert_negative_zero : float -> unit
val assert_array : string array -> string array -> unit
val assert_option_array : string option array -> string option array -> unit
val regexp_compile : string -> flags:string -> RegExp.t
val regexp_no_compile : string -> flags:string -> RegExp.compile_error
val assert_match : RegExp.match_result option -> string array -> unit

Assert that a match happened and that all captures participated with the given values. Group 0 is the full match.

val assert_captures : RegExp.match_result option -> string option array -> unit

Assert captures including non-participating groups (None).

val assert_no_match : RegExp.match_result option -> unit
val assert_match_index : RegExp.match_result option -> int -> unit

Assert the UTF-16 index of a match.

val assert_group : RegExp.match_result option -> string -> string option -> unit

Assert the value of a named group (None = absent or non-participating).

val assert_compile_error : expected:RegExp.compile_error -> RegExp.compile_error -> unit
val assert_unexpected_end : RegExp.compile_error -> unit
val assert_nothing_to_repeat : RegExp.compile_error -> unit
val assert_invalid_escape : RegExp.compile_error -> unit
val assert_malformed_unicode : RegExp.compile_error -> unit
val assert_invalid_flags : RegExp.compile_error -> unit
val string_contains : needle:string -> string -> bool
val assert_unknown_error : contains:string -> RegExp.compile_error -> unit
val max_safe_integer : float

Maximum safe integer in JavaScript: 2^53 - 1

val min_safe_integer : float

Minimum safe integer in JavaScript: -(2^53 - 1)

val max_value : float

Maximum value in JavaScript

val min_value : float

Minimum positive value in JavaScript

val epsilon : float

Epsilon in JavaScript

val assert_float_opt : float option -> float option -> unit
val assert_int_opt : int option -> int option -> unit
val assert_string_opt : string option -> string option -> unit
val assert_uchar : Uchar.t -> Uchar.t -> unit