summaryrefslogtreecommitdiff
path: root/ocaml/test_cue_solid.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ocaml/test_cue_solid.ml')
-rw-r--r--ocaml/test_cue_solid.ml17
1 files changed, 17 insertions, 0 deletions
diff --git a/ocaml/test_cue_solid.ml b/ocaml/test_cue_solid.ml
new file mode 100644
index 0000000..95be2da
--- /dev/null
+++ b/ocaml/test_cue_solid.ml
@@ -0,0 +1,17 @@
+open Nock_lib
+
+let () =
+ let bytes = Eio.Path.(load (Eio.Stdenv.fs (Eio_main.run (fun env -> env)) / "solid.pill")) |> Bytes.of_string in
+ Printf.printf "File size: %d bytes\n" (Bytes.length bytes);
+
+ let noun = Serial.cue bytes in
+ Printf.printf "Cued successfully\n";
+ Printf.printf "Is atom: %b\n" (Noun.is_atom noun);
+ Printf.printf "Is cell: %b\n" (Noun.is_cell noun);
+
+ if Noun.is_cell noun then begin
+ let h = Noun.head noun in
+ let t = Noun.tail noun in
+ Printf.printf "Head is atom: %b\n" (Noun.is_atom h);
+ Printf.printf "Tail is atom: %b\n" (Noun.is_atom t)
+ end