summaryrefslogtreecommitdiff
path: root/ocaml/test/test_slot3.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ocaml/test/test_slot3.ml')
-rw-r--r--ocaml/test/test_slot3.ml30
1 files changed, 30 insertions, 0 deletions
diff --git a/ocaml/test/test_slot3.ml b/ocaml/test/test_slot3.ml
new file mode 100644
index 0000000..246cfc3
--- /dev/null
+++ b/ocaml/test/test_slot3.ml
@@ -0,0 +1,30 @@
+(* Test slot 3 extraction to compare with C *)
+
+open Nock_lib
+
+let () =
+ Printf.printf "Loading ivory.pill...\n%!";
+ Eio_main.run (fun env ->
+ let fs = Eio.Stdenv.fs env in
+ let pill_bytes = Eio.Path.(load (fs / "ivory.pill")) |> Bytes.of_string in
+
+ Printf.printf "Cuing...\n%!";
+ let pill = Serial.cue pill_bytes in
+ let pill_mug = Noun.mug pill in
+ Printf.printf "Pill mug: 0x%08lx\n%!" pill_mug;
+
+ (* Extract core (tail of pill) *)
+ let core = Noun.tail pill in
+ let core_mug = Noun.mug core in
+ Printf.printf "Core mug: 0x%08lx\n%!" core_mug;
+
+ (* Extract slot 2 (head) *)
+ let slot2 = Noun.slot (Z.of_int 2) core in
+ let slot2_mug = Noun.mug slot2 in
+ Printf.printf "Slot 2 (head) mug: 0x%08lx\n%!" slot2_mug;
+
+ (* Extract slot 3 (tail) *)
+ let slot3 = Noun.slot (Z.of_int 3) core in
+ let slot3_mug = Noun.mug slot3 in
+ Printf.printf "Slot 3 (tail) mug: 0x%08lx\n%!" slot3_mug;
+ )