From 82d1e41f531fbe6343d2f720cc82e08928e8002c Mon Sep 17 00:00:00 2001 From: Xian Hui Chang Date: Mon, 29 Sep 2025 13:19:44 +0200 Subject: [PATCH 1/2] Add snarl count test --- src/unittest/snarl_distance_index.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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); From d033690cf117b5aa572cde633a65cfdbd36687c7 Mon Sep 17 00:00:00 2001 From: Xian Hui Chang Date: Mon, 29 Sep 2025 14:02:29 +0200 Subject: [PATCH 2/2] Update libbdsg to add get_snarl_child_count() --- deps/libbdsg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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