diff options
author | tatiana-yan <tatiana.kondakova@gmail.com> | 2019-02-05 13:31:37 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2019-02-05 13:36:57 +0300 |
commit | 8729a31c75f4d921d5357209cf4a18c6d2e27d52 (patch) | |
tree | a803d241e778e69e6fd9c9ee34bc0f3232813b61 /search | |
parent | 9384819e3dd50840f54b3378945978e27fa7d38c (diff) |
[search] Add countries/states synonyms search test.
Diffstat (limited to 'search')
-rw-r--r-- | search/search_integration_tests/processor_test.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/search/search_integration_tests/processor_test.cpp b/search/search_integration_tests/processor_test.cpp index 2550fa6d5e..99aae48df9 100644 --- a/search/search_integration_tests/processor_test.cpp +++ b/search/search_integration_tests/processor_test.cpp @@ -1679,5 +1679,32 @@ UNIT_CLASS_TEST(ProcessorTest, SquareAsStreetTest) TEST(ResultsMatch("revolution square 3", rules), ()); } } + +UNIT_CLASS_TEST(ProcessorTest, SynonymsTest) +{ + TestCountry usa(m2::PointD(0.5, 0.5), "United States of America", "en"); + TestPOI alabama(m2::PointD(0.5, 0.5), "Alabama", "en"); + alabama.SetTypes({{"place", "state"}}); + + auto worldId = BuildWorld([&](TestMwmBuilder & builder) + { + builder.Add(usa); + builder.Add(alabama); + }); + + SetViewport(m2::RectD(m2::PointD(0.0, 0.0), m2::PointD(1.0, 1.0))); + { + TRules rules = {ExactMatch(worldId, usa)}; + TEST(ResultsMatch("United States of America", rules), ()); + TEST(ResultsMatch("USA", rules), ()); + TEST(ResultsMatch("US", rules), ()); + } + + { + TRules rules = {ExactMatch(worldId, alabama)}; + TEST(ResultsMatch("Alabama", rules), ()); + TEST(ResultsMatch("AL", rules), ()); + } +} } // namespace } // namespace search |