Use CCFormat.sprintf to display a tree.

This commit is contained in:
Emm 2015-01-26 08:14:01 +01:00
parent f9d061af9e
commit 9cd3617a69

View file

@ -4,10 +4,8 @@ open OUnit
let format_node value = Printf.sprintf "%d" value let format_node value = Printf.sprintf "%d" value
let string_of_tree tree = let string_of_tree tree =
let buffer = Buffer.create 1024 in CCFormat.sprintf "%a" (fun formatter value ->
let formatter = Format.formatter_of_buffer buffer in RoseTree.print formatter format_node tree) tree
RoseTree.print formatter format_node tree;
Buffer.contents buffer
let assert_equal_tree expected_tree_rep tree = let assert_equal_tree expected_tree_rep tree =
let expected_tree_rep_string = let expected_tree_rep_string =