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:
authorArsentiy Milchakov <milcars@mapswithme.com>2017-11-24 16:51:21 +0300
committerIlya Zverev <ilya@zverev.info>2017-11-27 18:03:53 +0300
commit76cbee1c328cc10a1719bbac9fd2b6114f84bcae (patch)
tree44ae081086b59bf96fc6fba58b3c78584d67c2fc /indexer/indexer_tests
parent54eeceaa2e1b476a1c8c79d289112404db4a27bc (diff)
[editor] validate name method is added
Diffstat (limited to 'indexer/indexer_tests')
-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;