From 830e7c5d27d161b91402414e6ecd49f1ed818bfb Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 27 Mar 2026 08:48:05 +0100 Subject: Initial commit --- test/printer.ml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/printer.ml (limited to 'test/printer.ml') diff --git a/test/printer.ml b/test/printer.ml new file mode 100644 index 0000000..5469d5e --- /dev/null +++ b/test/printer.ml @@ -0,0 +1,22 @@ +let name = __FILE__ +let description = "Print the configuration in json format" +let speclist = [] + +type t = (Configuration.Ast.setting, Configuration.Read_conf.error) result + +module TomlConf = Configuration.Read_conf.Make (Configuration.Toml.Decode) + +let read_conf : + string -> + (Configuration.Ast.setting, Configuration.Toml.Decode.error) result = + fun file -> Configuration.Toml.Decode.decode_file TomlConf.t file + +module ToJson = Configuration.Read_conf.Make (Configuration.Json5.Encode) + +let print_conf : + Configuration.Ast.setting -> Configuration.Json5.Json_encodeable.value = + fun _ -> raise Not_found + +let pp : Format.formatter -> t -> unit = + Format.pp_print_result ~error:Configuration.Read_conf.pp_error + ~ok:Format.pp_print_int -- cgit v1.2.3