mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
Use CCFormat.sprintf to display a tree.
This commit is contained in:
parent
f9d061af9e
commit
9cd3617a69
1 changed files with 2 additions and 4 deletions
|
|
@ -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 =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue