Remove deprecated method calls from map tests
This commit is contained in:
+10
-10
@@ -48,7 +48,7 @@ macro_rules! vertex_map_tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sync_expands_to_new_vertices() {
|
fn expand_to_new_vertices() {
|
||||||
use $crate::traits::GraphTopology;
|
use $crate::traits::GraphTopology;
|
||||||
let mut graph = <$T>::new();
|
let mut graph = <$T>::new();
|
||||||
graph.add_vertex();
|
graph.add_vertex();
|
||||||
@@ -59,21 +59,21 @@ macro_rules! vertex_map_tests {
|
|||||||
}
|
}
|
||||||
assert!(
|
assert!(
|
||||||
map.capacity() < graph.vertex_capacity(),
|
map.capacity() < graph.vertex_capacity(),
|
||||||
"precondition: map is stale before sync"
|
"precondition: map is stale before expand"
|
||||||
);
|
);
|
||||||
map.sync(&graph);
|
map.expand(graph.vertex_capacity());
|
||||||
assert_eq!(map.capacity(), graph.vertex_capacity());
|
assert_eq!(map.capacity(), graph.vertex_capacity());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sync_does_not_overwrite_existing_values() {
|
fn expand_does_not_overwrite_existing_values() {
|
||||||
use $crate::traits::GraphTopology;
|
use $crate::traits::GraphTopology;
|
||||||
let mut graph = <$T>::new();
|
let mut graph = <$T>::new();
|
||||||
let v = graph.add_vertex();
|
let v = graph.add_vertex();
|
||||||
let mut map = graph.vertex_map(0);
|
let mut map = graph.vertex_map(0);
|
||||||
map[v] = 5;
|
map[v] = 5;
|
||||||
graph.add_vertex();
|
graph.add_vertex();
|
||||||
map.sync(&graph);
|
map.expand(graph.vertex_capacity());
|
||||||
assert_eq!(map[v], 5);
|
assert_eq!(map[v], 5);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -174,7 +174,7 @@ macro_rules! edge_map_tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sync_expands_to_new_edges() {
|
fn expand_to_new_edges() {
|
||||||
use $crate::traits::GraphTopology;
|
use $crate::traits::GraphTopology;
|
||||||
let mut graph = <$T>::new();
|
let mut graph = <$T>::new();
|
||||||
let v1 = graph.add_vertex();
|
let v1 = graph.add_vertex();
|
||||||
@@ -187,14 +187,14 @@ macro_rules! edge_map_tests {
|
|||||||
}
|
}
|
||||||
assert!(
|
assert!(
|
||||||
map.capacity() < graph.edge_capacity(),
|
map.capacity() < graph.edge_capacity(),
|
||||||
"precondition: map is stale before sync"
|
"precondition: map is stale before expand"
|
||||||
);
|
);
|
||||||
map.sync(&graph);
|
map.expand(graph.edge_capacity());
|
||||||
assert_eq!(map.capacity(), graph.edge_capacity());
|
assert_eq!(map.capacity(), graph.edge_capacity());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sync_does_not_overwrite_existing_values() {
|
fn expand_does_not_overwrite_existing_values() {
|
||||||
use $crate::traits::GraphTopology;
|
use $crate::traits::GraphTopology;
|
||||||
let mut graph = <$T>::new();
|
let mut graph = <$T>::new();
|
||||||
let v1 = graph.add_vertex();
|
let v1 = graph.add_vertex();
|
||||||
@@ -203,7 +203,7 @@ macro_rules! edge_map_tests {
|
|||||||
let mut map = graph.edge_map(0);
|
let mut map = graph.edge_map(0);
|
||||||
map[e] = 5;
|
map[e] = 5;
|
||||||
graph.add_edge(v1, v2);
|
graph.add_edge(v1, v2);
|
||||||
map.sync(&graph);
|
map.expand(graph.edge_capacity());
|
||||||
assert_eq!(map[e], 5);
|
assert_eq!(map[e], 5);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user