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

Unified Diff: third_party/libaddressinput/chromium/string_compare_unittest.cc

Issue 386873002: Reland "Use upstream libaddressinput in Chrome." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix iOS compile. Created 6 years, 5 months 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
« no previous file with comments | « third_party/libaddressinput/chromium/string_compare.cc ('k') | third_party/libaddressinput/chromium/trie.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libaddressinput/chromium/string_compare_unittest.cc
diff --git a/third_party/libaddressinput/chromium/string_compare_unittest.cc b/third_party/libaddressinput/chromium/string_compare_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0f9d9c79911757bc28a325707ab91e07d401db67
--- /dev/null
+++ b/third_party/libaddressinput/chromium/string_compare_unittest.cc
@@ -0,0 +1,26 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "third_party/libaddressinput/src/cpp/src/util/string_compare.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+TEST(ChromeStringCompareTest, IgnoreDiacritics) {
+ i18n::addressinput::StringCompare sc;
+ EXPECT_TRUE(sc.NaturalEquals("Texas", "T\u00E9xas"));
+}
+
+TEST(ChromeStringCompareTest, IgnoreCapitalization) {
+ i18n::addressinput::StringCompare sc;
+ EXPECT_TRUE(sc.NaturalEquals("Texas", "teXas"));
+}
+
+TEST(ChromeStringCompareTest, DifferentStringAreDifferent) {
+ i18n::addressinput::StringCompare sc;
+ EXPECT_FALSE(sc.NaturalEquals("Texas", "California"));
+}
+
+} // namespace
« no previous file with comments | « third_party/libaddressinput/chromium/string_compare.cc ('k') | third_party/libaddressinput/chromium/trie.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698