New patches from Fedora.
[fedora-mingw.git] / ocaml / test_format.ml
1 (* Test the Format module, which we suspect may not be working. *)
2
3 open Format
4
5 let debug = true
6
7 let () =
8   let buf = Buffer.create 100 in
9   let fmt = formatter_of_buffer buf in
10
11   if debug then
12     Printf.printf "pp_max_boxes before open_box = %d\n"
13       (pp_get_max_boxes fmt ());
14
15   pp_open_box fmt 0;
16
17   if debug then
18     Printf.printf "pp_max_boxes before open_box = %d\n"
19       (pp_get_max_boxes fmt ());
20
21   pp_print_string fmt "This is a string";
22   pp_close_box fmt ();
23   pp_print_flush fmt ();
24   let str = Buffer.contents buf in
25   Printf.printf "contents of buffer = %S\n%!" str