Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'indexer/indexer_tests/editable_map_object_test.cpp')
-rw-r--r--indexer/indexer_tests/editable_map_object_test.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indexer/indexer_tests/editable_map_object_test.cpp b/indexer/indexer_tests/editable_map_object_test.cpp
index be61b1772e..5f984cef2a 100644
--- a/indexer/indexer_tests/editable_map_object_test.cpp
+++ b/indexer/indexer_tests/editable_map_object_test.cpp
@@ -188,6 +188,25 @@ UNIT_TEST(EditableMapObject_ValidateEmail)
TEST(!EditableMapObject::ValidateEmail("email@e#$%&'*+-/=?^`_{}|~.com"), ());
}
+UNIT_TEST(EditableMapObject_ValidateName)
+{
+ vector<string> correctNames = {"abc", "абв", "ᆺᆯㅕ", "꫞ꪺꫀꪸ", "a b?c", "a!b.c", "a(b)c""a,b.c"};
+ vector<string> incorrectNames = {"a$bc", "a%bc", "a^bc", "a~bc", "a§bc", "a>bc", "a<bc", "a{bc",
+ "a[bc", "*", "a*bc", "a=bc", "a_bc", "a#bc", "a№bc", "a±bc",
+ "a\nbc", "a\tbc", "a\rbc", "a\vbc", "a\fbc", "a|bc", "N√",
+ "Hello World!\U0001F600", "Exit →", "∫0dx = C", "\U0001210A"};
+
+ for (auto const & name : correctNames)
+ {
+ TEST(EditableMapObject::ValidateName(name), ());
+ }
+
+ for (auto const & name : incorrectNames)
+ {
+ TEST(!EditableMapObject::ValidateName(name), ());
+ }
+}
+
UNIT_TEST(EditableMapObject_CanUseAsDefaultName)
{
EditableMapObject emo;