Skip to content

Commit 8ceeb39

Browse files
committed
Update answers in get_phone_number_info test.
1 parent eeb73d4 commit 8ceeb39

1 file changed

Lines changed: 20 additions & 19 deletions

File tree

‎test/country_info.cpp‎

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111

1212
static void check_phone_number_info(td::string phone_number_prefix, const td::string &country_code,
1313
const td::string &calling_code, const td::string &formatted_phone_number) {
14-
auto result = td::CountryInfoManager::get_phone_number_info_sync(td::string(), std::move(phone_number_prefix));
14+
auto result = td::CountryInfoManager::get_phone_number_info_sync(td::string(), phone_number_prefix);
1515
CHECK(result != nullptr);
1616
if (result->country_ == nullptr) {
1717
CHECK(country_code.empty());
1818
} else {
1919
CHECK(result->country_->country_code_ == country_code);
2020
}
2121
CHECK(result->country_calling_code_ == calling_code);
22+
// LOG(ERROR) << phone_number_prefix << ' ' << result->formatted_phone_number_ << ' ' << formatted_phone_number;
2223
CHECK(result->formatted_phone_number_ == formatted_phone_number);
2324
}
2425

@@ -52,7 +53,7 @@ TEST(CountryInfo, phone_number_info) {
5253
check_phone_number_info("77654321", "KZ", "7", "765 432 1- --");
5354
check_phone_number_info("3", "", "3", "");
5455
check_phone_number_info("37", "", "37", "");
55-
check_phone_number_info("372", "EE", "372", "---- ----");
56+
check_phone_number_info("372", "EE", "372", "---- ---");
5657
check_phone_number_info("42", "", "42", "");
5758
check_phone_number_info("420", "CZ", "420", "--- --- ---");
5859
check_phone_number_info("421", "SK", "421", "--- --- ---");
@@ -61,27 +62,27 @@ TEST(CountryInfo, phone_number_info) {
6162
check_phone_number_info("424", "YL", "42", "4");
6263
check_phone_number_info("4241234567890", "YL", "42", "41234567890");
6364
check_phone_number_info("4", "", "4", "");
64-
check_phone_number_info("49", "DE", "49", "---- -------");
65-
check_phone_number_info("491", "DE", "49", "1--- -------");
66-
check_phone_number_info("492", "DE", "49", "2--- -------");
67-
check_phone_number_info("4915", "DE", "49", "15-- -------");
68-
check_phone_number_info("4916", "DE", "49", "16- -------");
69-
check_phone_number_info("4917", "DE", "49", "17- -------");
70-
check_phone_number_info("4918", "DE", "49", "18-- -------");
71-
check_phone_number_info("493", "DE", "49", "3--- -------");
72-
check_phone_number_info("4936", "DE", "49", "36-- -------");
73-
check_phone_number_info("49360", "DE", "49", "360- -------");
74-
check_phone_number_info("493601", "DE", "49", "3601 -------");
75-
check_phone_number_info("4936014", "DE", "49", "3601 4------");
76-
check_phone_number_info("4936015", "DE", "49", "3601 5------");
77-
check_phone_number_info("493601419", "DE", "49", "3601 419----");
78-
check_phone_number_info("4936014198", "DE", "49", "3601 4198--");
79-
check_phone_number_info("49360141980", "DE", "49", "3601 41980-");
65+
check_phone_number_info("49", "DE", "49", "");
66+
check_phone_number_info("491", "DE", "49", "1");
67+
check_phone_number_info("492", "DE", "49", "2");
68+
check_phone_number_info("4915", "DE", "49", "15");
69+
check_phone_number_info("4916", "DE", "49", "16");
70+
check_phone_number_info("4917", "DE", "49", "17");
71+
check_phone_number_info("4918", "DE", "49", "18");
72+
check_phone_number_info("493", "DE", "49", "3");
73+
check_phone_number_info("4936", "DE", "49", "36");
74+
check_phone_number_info("49360", "DE", "49", "360");
75+
check_phone_number_info("493601", "DE", "49", "3601");
76+
check_phone_number_info("4936014", "DE", "49", "36014");
77+
check_phone_number_info("4936015", "DE", "49", "36015");
78+
check_phone_number_info("493601419", "DE", "49", "3601419");
79+
check_phone_number_info("4936014198", "DE", "49", "36014198");
80+
check_phone_number_info("49360141980", "DE", "49", "360141980");
8081
check_phone_number_info("841234567890", "VN", "84", "1234567890");
8182
check_phone_number_info("31", "NL", "31", "- -- -- -- --");
8283
check_phone_number_info("318", "NL", "31", "8 -- -- -- --");
8384
check_phone_number_info("319", "NL", "31", "9 -- -- -- --");
8485
check_phone_number_info("3196", "NL", "31", "9 6- -- -- --");
85-
check_phone_number_info("3197", "NL", "31", "97 ---- -----");
86+
check_phone_number_info("3197", "NL", "31", "9 7- -- -- --");
8687
check_phone_number_info("3198", "NL", "31", "9 8- -- -- --");
8788
}

0 commit comments

Comments
 (0)