forked from organicmaps/organicmaps
[search] Fixed tests according to “и-й” logic.
This commit is contained in:
parent
eb1b15ba2b
commit
221191ce03
2 changed files with 13 additions and 0 deletions
|
@ -10,12 +10,24 @@ UNIT_TEST(FeatureTypeToString)
|
|||
|
||||
UNIT_TEST(NormalizeAndSimplifyStringWithOurTambourines)
|
||||
{
|
||||
// This test is dependent from strings::NormalizeAndSimplifyString implementation.
|
||||
// TODO: Fix it when logic with и-й will change.
|
||||
|
||||
/*
|
||||
string const arr[] = {"ÜbërÅłłęšß", "uberallesss", // Basic test case.
|
||||
"Iiİı", "iiii", // Famous turkish "I" letter bug.
|
||||
"ЙЁйёШКИЙй", "йейешкийй", // Better handling of Russian й letter.
|
||||
"ØøÆ挜", "ooaeaeoeoe",
|
||||
"バス", "ハス"
|
||||
};
|
||||
*/
|
||||
string const arr[] = {"ÜbërÅłłęšß", "uberallesss", // Basic test case.
|
||||
"Iiİı", "iiii", // Famous turkish "I" letter bug.
|
||||
"ЙЁйёШКИЙй", "иеиешкиии", // Better handling of Russian й letter.
|
||||
"ØøÆ挜", "ooaeaeoeoe",
|
||||
"バス", "ハス"
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(arr); i += 2)
|
||||
TEST_EQUAL(arr[i + 1], strings::ToUtf8(search::NormalizeAndSimplifyString(arr[i])), (i));
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ inline strings::UniString NormalizeAndSimplifyString(string const & s)
|
|||
NormalizeInplace(uniString);
|
||||
return uniString;
|
||||
|
||||
/// @todo Restore this logic to distinguish и-й in future.
|
||||
/*
|
||||
// Just after lower casing is a correct place to avoid normalization for specific chars.
|
||||
static auto const isSpecificChar = [](UniChar c) -> bool
|
||||
|
|
Loading…
Add table
Reference in a new issue