use gsgdt::*;
mod helpers;
use helpers::*;
#[test]
fn test_multigraph_render() {
let g1 = read_graph_from_file("tests/small_graph.json");
let g2 = read_graph_from_file("tests/small_graph.json");
let settings: GraphvizSettings = Default::default();
let mg = MultiGraph::new("testgraph".into(), vec![g1, g2]);
let mut buf = Vec::new();
let expected = r#"digraph testgraph {
subgraph cluster_small {
bb0 [shape="none", label=<
bb0 |
StorageLive(_1)
|
_1 = Vec::<i32>::new() |
>];
bb1 [shape="none", label=<>];
bb0 -> bb1 [label="return"];
}
subgraph cluster_small {
bb0 [shape="none", label=<bb0 |
StorageLive(_1)
|
_1 = Vec::<i32>::new() |
>];
bb1 [shape="none", label=<>];
bb0 -> bb1 [label="return"];
}
}
"#;
mg.to_dot(&mut buf, &settings).unwrap();
assert_eq!(String::from_utf8(buf).unwrap(), expected);
}