X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=ocaml%2Ftest_format.ml;h=d6a74efac375a866fc49adb0fe03c76d6bb20495;hb=68f2f2ad6dfe0213cb73971d381b0de638d06656;hp=3f2f128e6b938fb22aad5da2c44d1bae95db3016;hpb=60a6a789a1e4dbac5373bc44a9aa005b618e3716;p=fedora-mingw.git diff --git a/ocaml/test_format.ml b/ocaml/test_format.ml index 3f2f128..d6a74ef 100644 --- a/ocaml/test_format.ml +++ b/ocaml/test_format.ml @@ -2,21 +2,24 @@ open Format -let debug = false +let debug = true let () = - if debug then Printf.printf "creating buffer ...\n%!"; let buf = Buffer.create 100 in - if debug then Printf.printf "creating formatter ...\n%!"; let fmt = formatter_of_buffer buf in - if debug then Printf.printf "open box ...\n%!"; + + if debug then + Printf.printf "pp_max_boxes before open_box = %d\n" + (pp_get_max_boxes fmt ()); + pp_open_box fmt 0; - if debug then Printf.printf "print string ...\n%!"; + + if debug then + Printf.printf "pp_max_boxes before open_box = %d\n" + (pp_get_max_boxes fmt ()); + pp_print_string fmt "This is a string"; - if debug then Printf.printf "close box ...\n%!"; pp_close_box fmt (); - if debug then Printf.printf "flush ...\n%!"; pp_print_flush fmt (); - if debug then Printf.printf "get buffer contents ...\n%!"; let str = Buffer.contents buf in Printf.printf "contents of buffer = %S\n%!" str