Module Alcotest_extra

Extended utilities for Alcotest used in TC39 Test262 tests

module RegExp = Quickjs.RegExp
val expected_failures : string list

Expected failures - tests that we know don't pass yet but want to track

val is_expected_failure : string -> bool

Check if a test is expected to fail

val test : ?expected_fail:bool -> string -> (unit -> Alcotest.return) -> unit Alcotest.test_case

Create a test case that handles expected failures

val test_by_id : string -> string -> (unit -> Alcotest.return) -> unit Alcotest.test_case

Create a test case by ID, auto-detecting expected failures

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 regexp_compile : string -> flags:string -> RegExp.t
val regexp_no_compile : string -> flags:string -> RegExp.compile_error
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 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