@@ -225,6 +225,10 @@ TEST_CASE("VertexInfo") {
225225 auto invalid_vertex_info2 =
226226 CreateVertexInfo (label, 0 , {pg}, " test_vertex/" , version);
227227 REQUIRE (invalid_vertex_info2->IsValidated () == false );
228+ // check if prefix empty
229+ auto vertex_info_empty_prefix =
230+ CreateVertexInfo (label, chunk_size, {pg}, " " , version);
231+ REQUIRE (vertex_info_empty_prefix->IsValidated () == true );
228232 }
229233
230234 SECTION (" Dump" ) {
@@ -246,6 +250,9 @@ prefix: test_vertex
246250version: gar/v1
247251)" ;
248252 REQUIRE (dump_result.value () == expected);
253+ auto vertex_info_empty_version =
254+ CreateVertexInfo (label, chunk_size, {pg}, " test_vertex/" );
255+ REQUIRE (vertex_info_empty_version->Dump ().status ().ok ());
249256 }
250257
251258 SECTION (" AddPropertyGroup" ) {
@@ -377,6 +384,11 @@ TEST_CASE("EdgeInfo") {
377384 src_label, edge_label, dst_label, chunk_size, src_chunk_size, 0 ,
378385 directed, {adj_list}, {pg}, " test_edge/" , version);
379386 REQUIRE (invalid_edge_info6->IsValidated () == false );
387+ // check if prefix empty
388+ auto edge_info_with_empty_prefix = CreateEdgeInfo (
389+ src_label, edge_label, dst_label, chunk_size, src_chunk_size,
390+ dst_chunk_size, directed, {adj_list}, {pg}, " " , version);
391+ REQUIRE (edge_info_with_empty_prefix->IsValidated () == true );
380392 }
381393
382394 SECTION (" Dump" ) {
@@ -408,6 +420,10 @@ src_label: person
408420version: gar/v1
409421)" ;
410422 REQUIRE (dump_result.value () == expected);
423+ auto edge_info_empty_version =
424+ CreateEdgeInfo (src_label, edge_label, dst_label, chunk_size,
425+ src_chunk_size, dst_chunk_size, directed, {}, {});
426+ REQUIRE (edge_info_empty_version->Dump ().status ().ok ());
411427 }
412428
413429 SECTION (" AddAdjacentList" ) {
@@ -512,6 +528,10 @@ TEST_CASE("GraphInfo") {
512528 auto invalid_graph_info3 =
513529 CreateGraphInfo (name, {vertex_info}, {edge_info}, " " , version);
514530 REQUIRE (invalid_graph_info3->IsValidated () == false );
531+ // check if prefix empty, graph_info with empty prefix is invalid
532+ auto graph_info_with_empty_prefix =
533+ CreateGraphInfo (name, {vertex_info}, {edge_info}, " " , version);
534+ REQUIRE (graph_info_with_empty_prefix->IsValidated () == false );
515535 }
516536
517537 SECTION (" Dump" ) {
@@ -526,6 +546,9 @@ version: gar/v1
526546 - test_vertex.vertex.yaml
527547)" ;
528548 REQUIRE (dump_result.value () == expected);
549+ auto graph_info_empty_version =
550+ CreateGraphInfo (name, {vertex_info}, {edge_info}, " test_graph/" );
551+ REQUIRE (graph_info_empty_version->Dump ().status ().ok ());
529552 }
530553
531554 SECTION (" AddVertex" ) {
0 commit comments