From 0232018b9cc4a19dac6bd6142f40b88d0a1d1612 Mon Sep 17 00:00:00 2001 From: Diana Kalinichenko Date: Tue, 2 Apr 2024 10:20:18 -0400 Subject: [PATCH 1/2] Re-export `Float_u`, `Iarray` and `IarrayLabels` --- ocaml/otherlibs/stable/stable.ml | 3 +++ ocaml/otherlibs/stable/stable.mli | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ocaml/otherlibs/stable/stable.ml b/ocaml/otherlibs/stable/stable.ml index e69de29bb2d..910ef6323bf 100644 --- a/ocaml/otherlibs/stable/stable.ml +++ b/ocaml/otherlibs/stable/stable.ml @@ -0,0 +1,3 @@ +module Float_u = Stdlib__Float_u +module Iarray = Stdlib__Iarray +module IarrayLabels = Stdlib__IarrayLabels diff --git a/ocaml/otherlibs/stable/stable.mli b/ocaml/otherlibs/stable/stable.mli index e69de29bb2d..910ef6323bf 100644 --- a/ocaml/otherlibs/stable/stable.mli +++ b/ocaml/otherlibs/stable/stable.mli @@ -0,0 +1,3 @@ +module Float_u = Stdlib__Float_u +module Iarray = Stdlib__Iarray +module IarrayLabels = Stdlib__IarrayLabels From 312f992adb6304e5fef8b0ce7156734d9556858c Mon Sep 17 00:00:00 2001 From: Diana Kalinichenko Date: Tue, 2 Apr 2024 10:35:54 -0400 Subject: [PATCH 2/2] Test exports of `Stable`. --- .../tests/lib-extensions/stable_exports.ml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ocaml/testsuite/tests/lib-extensions/stable_exports.ml diff --git a/ocaml/testsuite/tests/lib-extensions/stable_exports.ml b/ocaml/testsuite/tests/lib-extensions/stable_exports.ml new file mode 100644 index 00000000000..f2ff3677dcd --- /dev/null +++ b/ocaml/testsuite/tests/lib-extensions/stable_exports.ml @@ -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) +;;