Displaying 1 result from an estimated 1 matches for "test_tree_parse_file_basic".
2018 Aug 23
2
[PATCH 1/2] mltools: JSON: add json_parser_tree_parse_file
...JSON_parser_tests.ml
index 024817711..286724616 100644
--- a/common/mltools/JSON_parser_tests.ml
+++ b/common/mltools/JSON_parser_tests.ml
@@ -122,6 +122,28 @@ let test_tree_parse_inspect ctx =
   assert_is_number 10_L (List.nth a 2);
   assert_is_number 2_L (List.assoc "second" l)
 
+let test_tree_parse_file_basic ctx =
+  begin
+    let tmpfile, chan = bracket_tmpfile ctx in
+    output_string chan "{}\n";
+    flush chan;
+    close_out chan;
+    let value = json_parser_tree_parse_file tmpfile in
+    assert_is_object value
+  end;
+  begin
+    let tmpfile, chan = bracket_tmpfile ctx in
+    ou...