summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorseancarroll <seanc28@gmail.com>2021-01-08 21:35:19 -0600
committerseancarroll <seanc28@gmail.com>2021-01-08 21:35:19 -0600
commite1ff0f4992d896c9e5b47df079c1a3b33e49cd01 (patch)
tree19e22042dd54816fc565b91f5caefd7e21295517 /tests
parent4eb06140d996b1a5a6ac15578089ef9f61f95663 (diff)
downloaddotavious-e1ff0f4992d896c9e5b47df079c1a3b33e49cd01.zip
improving docs
Diffstat (limited to 'tests')
-rw-r--r--tests/dot.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/dot.rs b/tests/dot.rs
index fdd9545..fb97175 100644
--- a/tests/dot.rs
+++ b/tests/dot.rs
@@ -1,4 +1,4 @@
-use dotavious::attributes::{AttributeText, CompassPoint, GraphAttributeStatementBuilder, GraphAttributes, NodeStyle, PortPosition, RankDir, Shape, EdgeStyle};
+use dotavious::attributes::{AttributeText, CompassPoint, GraphAttributeStatementBuilder, GraphAttributes, NodeStyle, PortPosition, RankDir, Shape, EdgeStyle, Color};
use dotavious::{
Dot, Edge, EdgeAttributeStatementBuilder, EdgeAttributes, EdgeBuilder, Graph,
GraphBuilder, Node, NodeAttributeStatementBuilder, NodeAttributes, NodeBuilder,
@@ -7,10 +7,11 @@ use std::io;
use std::io::Read;
fn test_input(g: Graph) -> io::Result<String> {
- let mut writer = Vec::new();
+ let mut writer= Vec::new();
let dot = Dot { graph: g };
dot.render(&mut writer).unwrap();
+
let mut s = String::new();
Read::read_to_string(&mut &*writer, &mut s)?;
Ok(s)
@@ -285,7 +286,9 @@ fn graph_attributes() {
let node_attributes = NodeAttributeStatementBuilder::new()
.style(NodeStyle::Filled)
.build();
- let edge_attributes = EdgeAttributeStatementBuilder::new().min_len(1).build();
+ let edge_attributes = EdgeAttributeStatementBuilder::new()
+ .color(Color::Named("red"))
+ .build();
let g = GraphBuilder::new_directed(Some("graph_attributes".to_string()))
.add_graph_attributes(graph_attributes)
@@ -300,7 +303,7 @@ fn graph_attributes() {
r#"digraph graph_attributes {
graph [rankdir=LR];
node [style=filled];
- edge [minlen=1];
+ edge [color="red"];
}
"#
);