mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -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 string_of_tree tree =
|
||||
let buffer = Buffer.create 1024 in
|
||||
let formatter = Format.formatter_of_buffer buffer in
|
||||
RoseTree.print formatter format_node tree;
|
||||
Buffer.contents buffer
|
||||
CCFormat.sprintf "%a" (fun formatter value ->
|
||||
RoseTree.print formatter format_node tree) tree
|
||||
|
||||
let assert_equal_tree expected_tree_rep tree =
|
||||
let expected_tree_rep_string =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue