summaryrefslogtreecommitdiff
path: root/ocaml/tmp/test_jam.ml
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-05 22:57:55 +0700
committerpolwex <polwex@sortug.com>2025-10-05 22:57:55 +0700
commitc4b71435d9afdb67450f320f54fb7aa99dcae85e (patch)
treea08c4c2f7965a95fcfe6dda09629d3f103d25a0b /ocaml/tmp/test_jam.ml
parentfcedfddf00b3f994e4f4e40332ac7fc192c63244 (diff)
fixed jamcue
Diffstat (limited to 'ocaml/tmp/test_jam.ml')
-rw-r--r--ocaml/tmp/test_jam.ml17
1 files changed, 17 insertions, 0 deletions
diff --git a/ocaml/tmp/test_jam.ml b/ocaml/tmp/test_jam.ml
new file mode 100644
index 0000000..e616e3e
--- /dev/null
+++ b/ocaml/tmp/test_jam.ml
@@ -0,0 +1,17 @@
+open Nock_lib.Noun
+open Nock_lib.Serial
+
+let () =
+ let test n_int =
+ let n = atom n_int in
+ let jammed = jam n in
+ Printf.printf "jam(%d) = %s\n" n_int (bytes_to_hex jammed);
+ let cued = cue jammed in
+ match cued with
+ | Atom a -> Printf.printf "cue -> %s\n" (Z.to_string a)
+ | Cell _ -> Printf.printf "cue -> cell?!\n"
+ in
+ test 0;
+ test 1;
+ test 2;
+ test 42;