@@ -15,6 +15,7 @@ use crate::{
1515 api:: {
1616 edges:: { EdgeEntryOps , EdgeRefOps , EdgeSegmentOps } ,
1717 nodes:: { NodeEntryOps , NodeRefOps , NodeSegmentOps } ,
18+ graph:: GraphSegmentOps ,
1819 } ,
1920 error:: StorageError ,
2021 pages:: GraphStore ,
@@ -26,12 +27,13 @@ use super::fixtures::{AddEdge, Fixture, NodeFixture};
2627pub fn check_edges_support <
2728 NS : NodeSegmentOps < Extension = EXT > ,
2829 ES : EdgeSegmentOps < Extension = EXT > ,
30+ GS : GraphSegmentOps ,
2931 EXT : PersistentStrategy ,
3032> (
3133 edges : Vec < ( impl Into < VID > , impl Into < VID > , Option < usize > ) > , // src, dst, optional layer_id
3234 par_load : bool ,
3335 check_load : bool ,
34- make_graph : impl FnOnce ( & Path ) -> GraphStore < NS , ES , EXT > ,
36+ make_graph : impl FnOnce ( & Path ) -> GraphStore < NS , ES , GS , EXT > ,
3537) {
3638 let mut edges = edges
3739 . into_iter ( )
@@ -103,11 +105,12 @@ pub fn check_edges_support<
103105 fn check <
104106 NS : NodeSegmentOps < Extension = EXT > ,
105107 ES : EdgeSegmentOps < Extension = EXT > ,
108+ GS : GraphSegmentOps ,
106109 EXT : PersistentStrategy ,
107110 > (
108111 stage : & str ,
109112 expected_edges : & [ ( VID , VID , Option < usize > ) ] , // (src, dst, layer_id)
110- graph : & GraphStore < NS , ES , EXT > ,
113+ graph : & GraphStore < NS , ES , GS , EXT > ,
111114 ) {
112115 let nodes = graph. nodes ( ) ;
113116 let edges = graph. edges ( ) ;
@@ -189,7 +192,7 @@ pub fn check_edges_support<
189192 if check_load {
190193 drop ( graph) ;
191194
192- let maybe_ns = GraphStore :: < NS , ES , EXT > :: load ( graph_dir. path ( ) ) ;
195+ let maybe_ns = GraphStore :: < NS , ES , GS , EXT > :: load ( graph_dir. path ( ) ) ;
193196
194197 match maybe_ns {
195198 Ok ( graph) => {
@@ -206,10 +209,11 @@ pub fn check_graph_with_nodes_support<
206209 EXT : PersistentStrategy ,
207210 NS : NodeSegmentOps < Extension = EXT > ,
208211 ES : EdgeSegmentOps < Extension = EXT > ,
212+ GS : GraphSegmentOps ,
209213> (
210214 fixture : & NodeFixture ,
211215 check_load : bool ,
212- make_graph : impl FnOnce ( & Path ) -> GraphStore < NS , ES , EXT > ,
216+ make_graph : impl FnOnce ( & Path ) -> GraphStore < NS , ES , GS , EXT > ,
213217) {
214218 let NodeFixture {
215219 temp_props,
@@ -234,7 +238,7 @@ pub fn check_graph_with_nodes_support<
234238
235239 let check_fn = |temp_props : & [ ( VID , i64 , Vec < ( String , Prop ) > ) ] ,
236240 const_props : & [ ( VID , Vec < ( String , Prop ) > ) ] ,
237- graph : & GraphStore < NS , ES , EXT > | {
241+ graph : & GraphStore < NS , ES , GS , EXT > | {
238242 let mut ts_for_nodes = HashMap :: new ( ) ;
239243 for ( node, t, _) in temp_props {
240244 ts_for_nodes. entry ( * node) . or_insert_with ( Vec :: new) . push ( * t) ;
@@ -331,7 +335,7 @@ pub fn check_graph_with_nodes_support<
331335
332336 if check_load {
333337 drop ( graph) ;
334- let graph = GraphStore :: < NS , ES , EXT > :: load ( graph_dir. path ( ) ) . unwrap ( ) ;
338+ let graph = GraphStore :: < NS , ES , GS , EXT > :: load ( graph_dir. path ( ) ) . unwrap ( ) ;
335339 check_fn ( temp_props, const_props, & graph) ;
336340 }
337341}
@@ -340,10 +344,11 @@ pub fn check_graph_with_props_support<
340344 EXT : PersistentStrategy ,
341345 NS : NodeSegmentOps < Extension = EXT > ,
342346 ES : EdgeSegmentOps < Extension = EXT > ,
347+ GS : GraphSegmentOps ,
343348> (
344349 fixture : & Fixture ,
345350 check_load : bool ,
346- make_graph : impl FnOnce ( & Path ) -> GraphStore < NS , ES , EXT > ,
351+ make_graph : impl FnOnce ( & Path ) -> GraphStore < NS , ES , GS , EXT > ,
347352) {
348353 let Fixture { edges, const_props } = fixture;
349354 let graph_dir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -374,7 +379,7 @@ pub fn check_graph_with_props_support<
374379
375380 black_box ( assert ! ( graph. edges( ) . num_edges( ) > 0 ) ) ;
376381
377- let check_fn = |edges : & [ AddEdge ] , graph : & GraphStore < NS , ES , EXT > | {
382+ let check_fn = |edges : & [ AddEdge ] , graph : & GraphStore < NS , ES , GS , EXT > | {
378383 let mut edge_groups = HashMap :: new ( ) ;
379384 let mut node_groups: HashMap < VID , Vec < i64 > > = HashMap :: new ( ) ;
380385
@@ -485,7 +490,7 @@ pub fn check_graph_with_props_support<
485490 // Load the graph from disk and check again
486491 drop ( graph) ;
487492
488- let graph = GraphStore :: < NS , ES , EXT > :: load ( graph_dir. path ( ) ) . unwrap ( ) ;
493+ let graph = GraphStore :: < NS , ES , GS , EXT > :: load ( graph_dir. path ( ) ) . unwrap ( ) ;
489494 black_box ( check_fn ( edges, & graph) ) ;
490495 }
491496}
0 commit comments