summaryrefslogtreecommitdiff
path: root/ocaml/test/old/test_roundtrip.ml
blob: 4a4e6350149227d337ecd02a71ddaf0c0fa62aff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
open Nock_lib.Noun
open Nock_lib.Serial

let () =
  Printf.printf "Testing roundtrip...\n";
  let n = atom 42 in
  for i = 1 to 5 do
    Printf.printf "Iteration %d\n" i;
    let j = jam n in
    Printf.printf "  jammed: %s\n" (bytes_to_hex j);
    let c = cue j in
    Format.printf "  cued: %a\n" pp_noun c;
    flush stdout
  done;
  Printf.printf "Done!\n"