More test programs to track down Format / overflow bug.
[fedora-mingw.git] / ocaml / test_buffer.ml
diff --git a/ocaml/test_buffer.ml b/ocaml/test_buffer.ml
new file mode 100644 (file)
index 0000000..88ea48c
--- /dev/null
@@ -0,0 +1,11 @@
+(* Test the Buffer module. *)
+
+let () =
+  let buf = Buffer.create 100 in
+  for i = 0 to 10 do
+    Buffer.add_char buf 'a';
+    Buffer.add_string buf "b";
+    Buffer.add_char buf 'c'
+  done;
+  let str = Buffer.contents buf in
+  Printf.printf "contents of buffer = %S\n%!" str