Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-export stable extension modules from Stable. #2407

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ocaml/otherlibs/stable/stable.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Float_u = Stdlib__Float_u
module Iarray = Stdlib__Iarray
module IarrayLabels = Stdlib__IarrayLabels
3 changes: 3 additions & 0 deletions ocaml/otherlibs/stable/stable.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Float_u = Stdlib__Float_u
module Iarray = Stdlib__Iarray
module IarrayLabels = Stdlib__IarrayLabels
27 changes: 27 additions & 0 deletions ocaml/testsuite/tests/lib-extensions/stable_exports.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(* TEST
flags = "-extension-universe stable"
include stable
* bytecode
* native
*)

open Stable

(* Test that [Float_u] is exported. *)

let () =
let pi = Float_u.of_float 3.14 in
assert (Float_u.to_float pi = 3.14)
;;

(* Test that [Iarray] is exported. *)
let () =
let arr = Iarray.init 4 (fun x -> x) in
assert (Iarray.get arr 2 = 2)
;;

(* Test that [IarrayLabels] is exported. *)
let () =
let arr = IarrayLabels.init 4 ~f:(fun x -> x) in
assert (IarrayLabels.get arr 2 = 2)
;;
Loading