Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzarx1 committed Oct 29, 2024
1 parent c23574d commit 71934ae
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ use std::collections::HashMap;
///
/// let result: Graph<_, _, _, _, DefaultNodeShape, DefaultEdgeShape> = to_graph(&g);
///
/// assert_eq!(result.g.node_count(), 2);
/// assert_eq!(result.g.edge_count(), 1);
/// assert_eq!(result.node_count(), 2);
/// assert_eq!(result.edge_count(), 1);
///
/// let mut indxs = result.g.node_indices();
/// let mut indxs = result.node_indices();
/// let result_node1 = indxs.next().unwrap();
/// let result_node2 = indxs.next().unwrap();
/// assert_eq!(*result.g.node_weight(result_node1).unwrap().payload(), "A");
/// assert_eq!(*result.g.node_weight(result_node2).unwrap().payload(), "B");
/// assert_eq!(*result.node(result_node1).unwrap().payload(), "A");
/// assert_eq!(*result.node(result_node2).unwrap().payload(), "B");
///
/// assert_eq!(*result.g.edge_weight(result.g.edge_indices().next().unwrap()).unwrap().payload(), "edge1");
/// assert_eq!(*result.edge(result.edge_indices().next().unwrap()).unwrap().payload(), "edge1");
///
/// assert_eq!(*result.g.node_weight(result_node1).unwrap().label().clone(), format!("node {}", result_node1.index()));
/// assert_eq!(*result.g.node_weight(result_node2).unwrap().label().clone(), format!("node {}", result_node2.index()));
/// assert_eq!(*result.node(result_node1).unwrap().label().clone(), format!("node {}", result_node1.index()));
/// assert_eq!(*result.node(result_node2).unwrap().label().clone(), format!("node {}", result_node2.index()));
/// ```
pub fn to_graph<N, E, Ty, Ix, Dn, De>(g: &StableGraph<N, E, Ty, Ix>) -> Graph<N, E, Ty, Ix, Dn, De>
where
Expand Down

0 comments on commit 71934ae

Please sign in to comment.