Skip to content

Commit dccae3d

Browse files
Re-export stable extension modules from Stable. (#2407)
* Re-export `Float_u`, `Iarray` and `IarrayLabels` * Test exports of `Stable`. --------- Co-authored-by: Diana Kalinichenko <[email protected]>
1 parent b8cd5c5 commit dccae3d

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

ocaml/otherlibs/stable/stable.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Float_u = Stdlib__Float_u
2+
module Iarray = Stdlib__Iarray
3+
module IarrayLabels = Stdlib__IarrayLabels

ocaml/otherlibs/stable/stable.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Float_u = Stdlib__Float_u
2+
module Iarray = Stdlib__Iarray
3+
module IarrayLabels = Stdlib__IarrayLabels
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
(* TEST
2+
flags = "-extension-universe stable"
3+
include stable
4+
* bytecode
5+
* native
6+
*)
7+
8+
open Stable
9+
10+
(* Test that [Float_u] is exported. *)
11+
12+
let () =
13+
let pi = Float_u.of_float 3.14 in
14+
assert (Float_u.to_float pi = 3.14)
15+
;;
16+
17+
(* Test that [Iarray] is exported. *)
18+
let () =
19+
let arr = Iarray.init 4 (fun x -> x) in
20+
assert (Iarray.get arr 2 = 2)
21+
;;
22+
23+
(* Test that [IarrayLabels] is exported. *)
24+
let () =
25+
let arr = IarrayLabels.init 4 ~f:(fun x -> x) in
26+
assert (IarrayLabels.get arr 2 = 2)
27+
;;

0 commit comments

Comments
 (0)