@@ -447,6 +447,27 @@ void test_basic_csr_directed_graph_ext_props()
447
447
edge_weight);
448
448
}
449
449
450
+ void test_subgraphs () {
451
+ // on the BGL side, the new parser doesn't support subgraphs
452
+ // however, the docs promise to support reading them on the input side as "syntactic sugar".
453
+ for (auto gv : {
454
+ Fixture { " digraph {}" },
455
+ Fixture { " digraph { 1 -> {} }" , 1 },
456
+ Fixture { " digraph { 1 -> {2} }" , 2 },
457
+ Fixture { " digraph { 1; { 2; 3; } }" , 3 },
458
+ Fixture { " digraph { { 2; 3; } 1; }" , 3 },
459
+ Fixture { " digraph { 1; subgraph { 2; 3; } }" , 3 },
460
+ Fixture { " digraph { 1 -> subgraph { 2; 3; } }" , 3 },
461
+ Fixture { " digraph { 1 -> subgraph hello { 2; 3; } }" , 3 },
462
+ Fixture { " digraph { 1 -> subgraph clust_Hello { 2; 3; } }" , 3 },
463
+ Fixture { " digraph { 1 -> subgraph \" hello\" { 2; 3; } }" , 3 },
464
+ Fixture { " digraph { {2} -> subgraph \" hello\" {{{{{{{{{{{{{{{{{{{{{{{{ 2; 3; }}}}}}}}}}}}}}}}}}}}}}}} }" , 2 },
465
+ })
466
+ {
467
+ TEST_GRAPH (Models::DiGraph, gv);
468
+ }
469
+ }
470
+
450
471
int main ()
451
472
{
452
473
test_basic_directed_graph_1 ();
@@ -464,5 +485,6 @@ int main()
464
485
test_comments_embedded_in_strings ();
465
486
test_basic_csr_directed_graph_ext_props ();
466
487
test_basic_csr_directed_graph ();
488
+ test_subgraphs ();
467
489
return boost::report_errors ();
468
490
}
0 commit comments