use gsgdt::*;
mod helpers;
use helpers::get_small_graph;
#[test]
fn test_graph_render() {
let g1 = get_small_graph();
let settings: GraphvizSettings = Default::default();
let mut buf = Vec::new();
let expected = r#"digraph small {
bb0 [shape="none", label=<
bb0 |
_1 = const 1_i32
|
_2 = const 2_i32 |
>];
bb1 [shape="none", label=<bb1 |
_2 = const 2_i32
|
_3 = const 3_i32 |
>];
bb2 [shape="none", label=<>];
bb0 -> bb1 [label="return"];
bb1 -> bb2 [label="return"];
}
"#;
g1.to_dot(&mut buf, &settings, false).unwrap();
assert_eq!(String::from_utf8(buf).unwrap(), expected);
}