- List.iter tests ~f:(fun (name, code, tokens_expected) ->
- let open Printf in
- printf "%s\n==> Test %S: " bar_sep name;
+ let indent n = String.make (2 * n) ' ' in
+ let color_on_green = "\027[0;32m" in
+ let color_on_red = "\027[1;31m" in
+ let color_off = "\027[0m" in
+ List.iteri tests ~f:(fun i (name, code, tokens_expected) ->
+ let i = i + 1 in (* Because iteri starts with 0 *)
+ printf "%s\n%sTest %d : %S\n" bar_sep (indent 0) i name;
+
+ printf "%sLexing : " (indent 1);