Commits

Sebastien Mondet  committed d5762af

test: add a first test file

  • Participants
  • Parent commits 407a708

Comments (0)

Files changed (1)

+#!/usr/bin/env ocaml
+
+#use "topfind"
+#thread
+#require "smart_print"
+#directory "_build/"
+#load "_build/docout.cma"
+
+
+let global_debug_level = ref 2
+let global_with_color = ref true
+module Log = 
+  Docout.Make_logger (struct
+    type ('a, 'b) result = 'a
+    let debug_level () = !global_debug_level
+    let with_color () = !global_with_color
+    let line_width = 70
+    let indent = 4
+    let print_string = Printf.eprintf "%s%!"
+    let do_nothing () = ()
+    let name = "Test_of_docout"
+  end)
+
+let print_stuff () =
+  Log.(s "some stuff" % n @ normal);
+  Log.(s "some error" % n @ error);
+  Log.(s "debug level things" % n @ verbose);
+  ()
+
+let () =
+  print_stuff ();
+  global_with_color := false;
+  global_debug_level := 0;
+  print_stuff ();
+