mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 11:45:31 -05:00
fixes, do not run Format tests on < 4.08
This commit is contained in:
parent
0ce613d7c4
commit
5a4adfa76b
2 changed files with 16 additions and 15 deletions
|
|
@ -19,6 +19,7 @@ let do_not_test file =
|
||||||
assert (not (is_suffix ~sub:"make.ml" file));
|
assert (not (is_suffix ~sub:"make.ml" file));
|
||||||
str_sub ~sub:"Labels.ml" file ||
|
str_sub ~sub:"Labels.ml" file ||
|
||||||
is_suffix ~sub:".pp.ml" file ||
|
is_suffix ~sub:".pp.ml" file ||
|
||||||
|
(if Sys.ocaml_version < "4.08" then Filename.basename file = "CCFormat.ml" else false) ||
|
||||||
is_suffix ~sub:".pp.mli" file ||
|
is_suffix ~sub:".pp.mli" file ||
|
||||||
is_suffix ~sub:"containers.ml" file ||
|
is_suffix ~sub:"containers.ml" file ||
|
||||||
is_suffix ~sub:"_top.ml" file ||
|
is_suffix ~sub:"_top.ml" file ||
|
||||||
|
|
|
||||||
|
|
@ -407,6 +407,19 @@ let set_color_tag_handling ppf =
|
||||||
in
|
in
|
||||||
pp_set_formatter_stag_functions ppf funs'
|
pp_set_formatter_stag_functions ppf funs'
|
||||||
|
|
||||||
|
(*$R
|
||||||
|
set_color_default true;
|
||||||
|
let s = sprintf
|
||||||
|
"what is your %a? %a! No, %a! Ahhhhhhh@."
|
||||||
|
(styling [`FG `White; `Bold] string) "favorite color"
|
||||||
|
(styling [`FG `Blue] string) "blue"
|
||||||
|
(styling [`FG `Red] string) "red"
|
||||||
|
in
|
||||||
|
assert_equal ~printer:CCFun.id
|
||||||
|
"what is your \027[37;1mfavorite color\027[0m? \027[34mblue\027[0m! No, \027[31mred\027[0m! Ahhhhhhh\n"
|
||||||
|
s
|
||||||
|
*)
|
||||||
|
|
||||||
[@@@else_]
|
[@@@else_]
|
||||||
|
|
||||||
(* either prints the tag of [s] or delegate to [or_else] *)
|
(* either prints the tag of [s] or delegate to [or_else] *)
|
||||||
|
|
@ -435,9 +448,9 @@ let set_color_tag_handling ppf =
|
||||||
let functions = {
|
let functions = {
|
||||||
funs with
|
funs with
|
||||||
mark_open_tag = mark_open_tag st ~or_else:funs.mark_open_tag;
|
mark_open_tag = mark_open_tag st ~or_else:funs.mark_open_tag;
|
||||||
mark_close_stag = mark_close_tag st ~or_else:funs.mark_close_tag;
|
mark_close_tag = mark_close_tag st ~or_else:funs.mark_close_tag;
|
||||||
} in
|
} in
|
||||||
pp_set_formatter_stag_functions ppf functions
|
pp_set_formatter_tag_functions ppf functions
|
||||||
|
|
||||||
[@@@endif]
|
[@@@endif]
|
||||||
|
|
||||||
|
|
@ -463,19 +476,6 @@ let set_color_default =
|
||||||
s
|
s
|
||||||
*)
|
*)
|
||||||
|
|
||||||
(*$R
|
|
||||||
set_color_default true;
|
|
||||||
let s = sprintf
|
|
||||||
"what is your %a? %a! No, %a! Ahhhhhhh@."
|
|
||||||
(styling [`FG `White; `Bold] string) "favorite color"
|
|
||||||
(styling [`FG `Blue] string) "blue"
|
|
||||||
(styling [`FG `Red] string) "red"
|
|
||||||
in
|
|
||||||
assert_equal ~printer:CCFun.id
|
|
||||||
"what is your \027[37;1mfavorite color\027[0m? \027[34mblue\027[0m! No, \027[31mred\027[0m! Ahhhhhhh\n"
|
|
||||||
s
|
|
||||||
*)
|
|
||||||
|
|
||||||
let with_color s pp out x =
|
let with_color s pp out x =
|
||||||
pp_open_tag out s;
|
pp_open_tag out s;
|
||||||
pp out x;
|
pp out x;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue