summaryrefslogtreecommitdiff
path: root/test/printer.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/printer.ml')
-rw-r--r--test/printer.ml22
1 files changed, 22 insertions, 0 deletions
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