Added nice DebugPrint for search::Result.

This commit is contained in:
vng 2016-05-04 15:53:53 +03:00 committed by Vladimir Byko-Ianko
parent 209672dffa
commit d0ed3ab490
2 changed files with 3 additions and 8 deletions

View file

@ -320,13 +320,8 @@ string DebugPrint(AddressInfo const & info)
string DebugPrint(Result const & r)
{
string s;
s.append(r.GetString());
s.append("|");
s.append(r.GetFeatureType());
s.append("|");
s.append(r.IsSuggest() ? "1" : "0");
return s;
return "Result { Name: " + r.GetString() + "; Type: " + r.GetFeatureType() +
"; Info: " + DebugPrint(r.GetRankingInfo()) + " }";
}
} // namespace search

View file

@ -334,7 +334,7 @@ UNIT_CLASS_TEST(SearchQueryV2Test, TestRankingInfo)
for (auto const & result : request.Results())
{
auto const & info = result.GetRankingInfo();
TEST_EQUAL(NAME_SCORE_FULL_MATCH, info.m_nameScore, ());
TEST_EQUAL(NAME_SCORE_FULL_MATCH, info.m_nameScore, (result));
TEST(my::AlmostEqualAbs(1.0, info.m_nameCoverage, 1e-6), (info.m_nameCoverage));
}
}