Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 // Copyright (C) 2011 The Libphonenumber Authors | 1 // Copyright (C) 2011 The Libphonenumber Authors |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
521 EXPECT_TRUE(matcher->Next(&match_with_spaces)); | 521 EXPECT_TRUE(matcher->Next(&match_with_spaces)); |
522 EXPECT_EQ(expected_result, match_with_spaces.number()); | 522 EXPECT_EQ(expected_result, match_with_spaces.number()); |
523 EXPECT_EQ(number, match_with_spaces.raw_string()); | 523 EXPECT_EQ(number, match_with_spaces.raw_string()); |
524 } | 524 } |
525 | 525 |
526 TEST_F(PhoneNumberMatcherTest, IsLatinLetter) { | 526 TEST_F(PhoneNumberMatcherTest, IsLatinLetter) { |
527 EXPECT_TRUE(IsLatinLetter('c')); | 527 EXPECT_TRUE(IsLatinLetter('c')); |
528 EXPECT_TRUE(IsLatinLetter('C')); | 528 EXPECT_TRUE(IsLatinLetter('C')); |
529 EXPECT_TRUE(IsLatinLetter(UnicodeString::fromUTF8("\xC3\x89" /* "É" */)[0])); | 529 EXPECT_TRUE(IsLatinLetter(UnicodeString::fromUTF8("\xC3\x89" /* "É" */)[0])); |
530 // Combining acute accent. | 530 // Combining acute accent. |
531 EXPECT_TRUE(IsLatinLetter(UnicodeString("\xCC\x81")[0])); | 531 EXPECT_TRUE(IsLatinLetter(UnicodeString::fromUTF8("\xCC\x81")[0])); |
leandrogracia
2012/02/04 23:56:44
fromUTF8 is required here too.
philippe
2012/02/06 17:12:32
Done.
| |
532 EXPECT_FALSE(IsLatinLetter(':')); | 532 EXPECT_FALSE(IsLatinLetter(':')); |
533 EXPECT_FALSE(IsLatinLetter('5')); | 533 EXPECT_FALSE(IsLatinLetter('5')); |
534 EXPECT_FALSE(IsLatinLetter('-')); | 534 EXPECT_FALSE(IsLatinLetter('-')); |
535 EXPECT_FALSE(IsLatinLetter('.')); | 535 EXPECT_FALSE(IsLatinLetter('.')); |
536 EXPECT_FALSE(IsLatinLetter(' ')); | 536 EXPECT_FALSE(IsLatinLetter(' ')); |
537 EXPECT_FALSE( | 537 EXPECT_FALSE( |
538 IsLatinLetter(UnicodeString::fromUTF8("\xE6\x88\x91" /* "我" */)[0])); | 538 IsLatinLetter(UnicodeString::fromUTF8("\xE6\x88\x91" /* "我" */)[0])); |
539 } | 539 } |
540 | 540 |
541 TEST_F(PhoneNumberMatcherTest, MatchesWithSurroundingLatinChars) { | 541 TEST_F(PhoneNumberMatcherTest, MatchesWithSurroundingLatinChars) { |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1025 RegionCode::GetUnknown(), | 1025 RegionCode::GetUnknown(), |
1026 PhoneNumberMatcher::VALID)); | 1026 PhoneNumberMatcher::VALID)); |
1027 | 1027 |
1028 EXPECT_TRUE(matcher->Next(&match)); | 1028 EXPECT_TRUE(matcher->Next(&match)); |
1029 EXPECT_TRUE(matcher->Next(&match)); | 1029 EXPECT_TRUE(matcher->Next(&match)); |
1030 EXPECT_FALSE(matcher->Next(&match)); | 1030 EXPECT_FALSE(matcher->Next(&match)); |
1031 } | 1031 } |
1032 | 1032 |
1033 } // namespace phonenumbers | 1033 } // namespace phonenumbers |
1034 } // namespace i18n | 1034 } // namespace i18n |
LEFT | RIGHT |