Skip to content
Snippets Groups Projects
Commit 92ae3efc authored by Udo Eisenbarth's avatar Udo Eisenbarth :speech_balloon:
Browse files

Add unit test for "To_dot" with edges.

parent a8aaefa7
No related branches found
No related tags found
No related merge requests found
......@@ -137,6 +137,18 @@ mod test {
);
}
#[test]
fn to_dot_with_edge() {
let mut scenery = OpticScenery::new();
scenery.set_description("SceneryTest".into());
let n1=scenery.add_node(OpticNode::new("Test1", Box::new(NodeDummy)));
let n2=scenery.add_node(OpticNode::new("Test2", Box::new(NodeDummy)));
scenery.connect_nodes(n1,n2);
assert_eq!(
scenery.to_dot(),
"digraph {\n label=\"SceneryTest\"\n \"Test1\"\n \"Test2\"\n \"Test1\" -> \"Test2\"\n}"
);
}
#[test]
fn set_description() {
let mut scenery = OpticScenery::new();
scenery.set_description("Test".into());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment