Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: third_party/libphonenumber/cpp/src/utf/unicodetext_test.cc

Issue 8762016: Revert 112305 - Pull the phone library directly. Delete old version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Full revert, I hope Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/libphonenumber/cpp/src/utf/unicodetext_test.cc
diff --git a/third_party/libphonenumber/cpp/src/utf/unicodetext_test.cc b/third_party/libphonenumber/cpp/src/utf/unicodetext_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..81100c5ce71a5004e77459ebd91a44ba7d59117d
--- /dev/null
+++ b/third_party/libphonenumber/cpp/src/utf/unicodetext_test.cc
@@ -0,0 +1,45 @@
+// Copyright 2011 Facebook, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+//
+// Author: Ben Gertzfield
+
+#include <gtest/gtest.h>
+
+#include "unicodetext.h"
+
+namespace i18n {
+namespace unicodetext {
+
+TEST(UnicodeTextTest, Iterator) {
+ struct value {
+ const char* utf8;
+ char32 code_point;
+ } values[] = {
+ { "\x31", 0x31 }, // U+0031 DIGIT ONE
+ { "\xC2\xBD", 0x00BD }, // U+00BD VULGAR FRACTION ONE HALF
+ { "\xEF\xBC\x91", 0xFF11 }, // U+FF11 FULLWIDTH DIGIT ONE
+ { "\xF0\x9F\x80\x80", 0x1F000 }, // U+1F000 MAHJONG TILE EAST WIND
+ };
+
+ for (size_t i = 0; i < sizeof values / sizeof values[0]; i++) {
+ string number(values[i].utf8);
+ UnicodeText number_as_unicode;
+ number_as_unicode.PointToUTF8(number.data(), number.size());
+ UnicodeText::const_iterator it = number_as_unicode.begin();
+ EXPECT_EQ(values[i].code_point, *it);
+ }
+}
+
+} // namespace unicodetext
+} // namespace i18n
« no previous file with comments | « third_party/libphonenumber/cpp/src/utf/unicodetext.cc ('k') | third_party/libphonenumber/cpp/src/utf/unilib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698