diff --git a/tests/read.cc b/tests/read.cc index 0fdcf3ce..de33f816 100644 --- a/tests/read.cc +++ b/tests/read.cc @@ -29,29 +29,30 @@ using namespace flox; test_distanceFromMatch() { std::tuple cases[] = { - { "match", "match", 0 }, - { "match", "partial match", 0 }, - { "match", "miss", 0 }, - { "partial match", "match", 1 }, - { "partial match", "partial match", 1 }, - { "partial match", "miss", 2 }, - { "miss", "match", 3 }, - { "miss", "partial match", 3 }, - { "miss", "miss", 4 }, + { "match", "match", 0 } + , { "match", "partial match", 0 } + , { "match", "miss", 0 } + , { "partial match", "match", 1 } + , { "partial match", "partial match", 1 } + , { "partial match", "miss", 2 } + , { "miss", "match", 3 } + , { "miss", "partial match", 3 } + , { "miss", "miss", 4 } }; RawPackage pkg; - for (auto [pname, description, distance] : cases) { - pkg = RawPackage(nlohmann::json { - { "name", "name" }, - { "pname", pname }, - { "description", description }, - }); - EXPECT_EQ(*pkgdb::distanceFromMatch(pkg, "match"), distance); - } + for ( auto [pname, description, distance] : cases ) + { + pkg = RawPackage( nlohmann::json { + { "name", "name" } + , { "pname", pname } + , { "description", description } + } ); + EXPECT_EQ( * pkgdb::distanceFromMatch( pkg, "match"), distance ); + } - // Should return std::nullopt for empty match string. - EXPECT(pkgdb::distanceFromMatch(pkg, "") == std::nullopt); + /* Should return std::nullopt for empty match string. */ + EXPECT( pkgdb::distanceFromMatch( pkg, "" ) == std::nullopt ); return true; }