From ed54d10de6a0b330c9546ba7f7906084404efebe Mon Sep 17 00:00:00 2001 From: chansuke Date: Thu, 6 Jun 2019 00:55:07 +0900 Subject: [PATCH] Separate libgraphviz module --- src/libgraphviz/lib.rs | 383 +-------------------------------------- src/libgraphviz/tests.rs | 380 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 381 insertions(+), 382 deletions(-) create mode 100644 src/libgraphviz/tests.rs diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index 489020d4ee77..a34e4fb89ff2 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -684,385 +684,4 @@ pub fn render_opts<'a, N, E, G, W>(g: &'a G, } #[cfg(test)] -mod tests { - use NodeLabels::*; - use super::{Id, Labeller, Nodes, Edges, GraphWalk, render, Style}; - use super::LabelText::{self, LabelStr, EscStr, HtmlStr}; - use std::io; - use std::io::prelude::*; - - /// each node is an index in a vector in the graph. - type Node = usize; - struct Edge { - from: usize, - to: usize, - label: &'static str, - style: Style, - } - - fn edge(from: usize, to: usize, label: &'static str, style: Style) -> Edge { - Edge { - from, - to, - label, - style, - } - } - - struct LabelledGraph { - /// The name for this graph. Used for labeling generated `digraph`. - name: &'static str, - - /// Each node is an index into `node_labels`; these labels are - /// used as the label text for each node. (The node *names*, - /// which are unique identifiers, are derived from their index - /// in this array.) - /// - /// If a node maps to None here, then just use its name as its - /// text. - node_labels: Vec>, - - node_styles: Vec