diff --git a/deps/libbdsg b/deps/libbdsg index 2f2943fb246..78ae6632540 160000 --- a/deps/libbdsg +++ b/deps/libbdsg @@ -1 +1 @@ -Subproject commit 2f2943fb2465ffd749403e72888a06fa4c603de3 +Subproject commit 78ae6632540545e1e60c6bfb3978925abc311e55 diff --git a/src/unittest/snarl_distance_index.cpp b/src/unittest/snarl_distance_index.cpp index b66c72129cf..3d84f142832 100644 --- a/src/unittest/snarl_distance_index.cpp +++ b/src/unittest/snarl_distance_index.cpp @@ -260,6 +260,27 @@ namespace vg { //REQUIRE(!distance_index.is_regular_snarl(distance_index.get_parent(distance_index.get_parent(distance_index.get_node_net_handle(n6->id()))), false, &graph)); } } + SECTION("Snarl child counts are correct") { + SECTION("Distance index") { + SnarlDistanceIndex distance_index; + fill_in_distance_index(&distance_index, &graph, &snarl_finder); + REQUIRE(distance_index.get_snarl_child_count(distance_index.get_parent(distance_index.get_parent(distance_index.get_node_net_handle(n3->id())))) + == 1); + REQUIRE(distance_index.get_snarl_child_count(distance_index.get_parent(distance_index.get_parent(distance_index.get_node_net_handle(n8->id())))) + == 2); + REQUIRE(distance_index.get_snarl_child_count(distance_index.get_parent(distance_index.get_parent(distance_index.get_node_net_handle(n6->id())))) + == 2); + } SECTION("Distanceless index") { + SnarlDistanceIndex distance_index; + fill_in_distance_index(&distance_index, &graph, &snarl_finder, 0); + REQUIRE(distance_index.get_snarl_child_count(distance_index.get_parent(distance_index.get_parent(distance_index.get_node_net_handle(n3->id())))) + == 1); + REQUIRE(distance_index.get_snarl_child_count(distance_index.get_parent(distance_index.get_parent(distance_index.get_node_net_handle(n8->id())))) + == 2); + REQUIRE(distance_index.get_snarl_child_count(distance_index.get_parent(distance_index.get_parent(distance_index.get_node_net_handle(n6->id())))) + == 2); + } + } SECTION("Minimum distances are correct") { SnarlDistanceIndex distance_index; fill_in_distance_index(&distance_index, &graph, &snarl_finder);