From fb0233bb1fe780b9e8d2d41bce594da156bb2b4d Mon Sep 17 00:00:00 2001 From: mccakit Date: Tue, 10 Mar 2026 01:56:17 +0300 Subject: [PATCH 1/2] remove fmt dependency --- include/graaflib/algorithm/shortest_path/a_star.tpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/graaflib/algorithm/shortest_path/a_star.tpp b/include/graaflib/algorithm/shortest_path/a_star.tpp index 3f8fc8e3..c39e6524 100644 --- a/include/graaflib/algorithm/shortest_path/a_star.tpp +++ b/include/graaflib/algorithm/shortest_path/a_star.tpp @@ -60,9 +60,10 @@ std::optional> a_star_search( // A* search does not work on negative edge weights. if (edge_weight < 0) { - throw std::invalid_argument{fmt::format( - "Negative edge weight [{}] between vertices [{}] -> [{}].", - edge_weight, current.id, neighbor)}; + throw std::invalid_argument{ + "Negative edge weight [" + std::to_string(edge_weight) + + "] between vertices [" + std::to_string(current.id) + "] -> [" + + std::to_string(neighbor) + "]."}; } // tentative_g_score is the distance from start to the neighbor through From b1fc5d986e631720d78df59adb1af2d46ab43e3e Mon Sep 17 00:00:00 2001 From: Bob Luppes Date: Fri, 27 Mar 2026 21:42:07 +0100 Subject: [PATCH 2/2] fix expected exception message in test --- test/graaflib/algorithm/shortest_path/a_star_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/graaflib/algorithm/shortest_path/a_star_test.cpp b/test/graaflib/algorithm/shortest_path/a_star_test.cpp index e3c67e0a..ec27bd0e 100644 --- a/test/graaflib/algorithm/shortest_path/a_star_test.cpp +++ b/test/graaflib/algorithm/shortest_path/a_star_test.cpp @@ -193,7 +193,7 @@ TYPED_TEST(AStarShortestPathSignedTypesTest, AStarNegativeWeight) { ex.what(), fmt::format( "Negative edge weight [{}] between vertices [{}] -> [{}].", - -1, vertex_id_1, vertex_id_2)); + std::to_string(weight_t{-1}), vertex_id_1, vertex_id_2)); throw; } },