From d2f16d58d8dcf3a2732f91a01c66fca53f871129 Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Mon, 8 Apr 2024 15:48:21 -0300 Subject: [PATCH] [search] Do not emit private swimming pools. Signed-off-by: Viktor Govako --- data/categories.txt | 4 +++ .../processor_test.cpp | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/data/categories.txt b/data/categories.txt index ef831fd34d..16eb46ea89 100644 --- a/data/categories.txt +++ b/data/categories.txt @@ -8049,6 +8049,10 @@ sw:Bwawa la kuogelea fa:استخرشنا mr:जलतरण तलाव +# Not searchable +leisure-swimming_pool-private +en:DoNotMatchThisType_OneLanguageDefinitionIsEnoughHere + sport-american_football en:American Football ar:كرة القدم الأمريكية diff --git a/search/search_integration_tests/processor_test.cpp b/search/search_integration_tests/processor_test.cpp index ee7be1f336..8f8a268209 100644 --- a/search/search_integration_tests/processor_test.cpp +++ b/search/search_integration_tests/processor_test.cpp @@ -3641,4 +3641,30 @@ UNIT_CLASS_TEST(ProcessorTest, NonDrawable_Categories) } } +UNIT_CLASS_TEST(ProcessorTest, NonSearchable_Categories) +{ + TestPOI yesPool({0, 0}, {}, {}); + yesPool.SetTypes({{"leisure", "swimming_pool"}}); + + TestPOI noPool({0.1, 0.1}, {}, {}); + noPool.SetTypes({{"leisure", "swimming_pool", "private"}}); + + auto wonderlandId = BuildCountry("Wonderland", [&](TestMwmBuilder & builder) + { + builder.Add(yesPool); + builder.Add(noPool); + }); + + SetViewport(m2::RectD(-0.5, -0.5, 0.5, 0.5)); + + { + Rules const rules = {ExactMatch(wonderlandId, yesPool)}; + TEST(ResultsMatch("swimming pool", rules), ()); + } + { + Rules const rules = {ExactMatch(wonderlandId, yesPool)}; + TEST(ResultsMatch("бассейн", rules, "ru"), ()); + } +} + } // namespace processor_test