Merge branch 'main' into release-0.3.0

This commit is contained in:
2026-07-31 10:16:03 +02:00
12 changed files with 804 additions and 67 deletions
+5 -21
View File
@@ -48,7 +48,7 @@ macro_rules! entity_map_tests {
}
#[test]
fn extend_to_new_vertices() {
fn expand_to_new_vertices() {
use $crate::traits::GraphTopology;
let mut graph = <$T>::new();
graph.add_vertex();
@@ -59,21 +59,21 @@ macro_rules! entity_map_tests {
}
assert!(
map.capacity() < graph.vertex_capacity(),
"precondition: map is stale before extend"
"precondition: map is stale before expand"
);
map.extend(graph.vertex_capacity());
map.expand(graph.vertex_capacity());
assert_eq!(map.capacity(), graph.vertex_capacity());
}
#[test]
fn extend_does_not_overwrite_existing_values() {
fn expand_does_not_overwrite_existing_values() {
use $crate::traits::GraphTopology;
let mut graph = <$T>::new();
let v = graph.add_vertex();
let mut map = graph.vertex_map(0);
map[v] = 5;
graph.add_vertex();
map.extend(graph.vertex_capacity());
map.expand(graph.vertex_capacity());
assert_eq!(map[v], 5);
}
};
@@ -97,22 +97,6 @@ macro_rules! entity_map_deletion_tests {
assert_eq!(map[v1], 1);
}
#[test]
fn capacity_does_not_shrink_after_delete() {
use $crate::traits::GraphTopology;
use $crate::traits::GraphTopologyDeletion;
let mut graph = <$T>::new();
let v1 = graph.add_vertex();
let v2 = graph.add_vertex();
let mut map = graph.vertex_map(0);
map[v1] = 5;
let capacity_before = graph.vertex_capacity();
graph.delete_vertex(v2);
map.extend(graph.vertex_capacity());
assert_eq!(map.capacity(), capacity_before);
assert_eq!(map[v1], 5);
}
#[test]
fn reused_slot_returns_old_value() {
use $crate::traits::GraphTopology;