Home | History | Annotate | Download | only in chromium
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "third_party/libaddressinput/src/cpp/src/util/string_compare.h"
      6 
      7 #include "base/strings/utf_string_conversions.h"
      8 #include "testing/gtest/include/gtest/gtest.h"
      9 
     10 namespace {
     11 
     12 TEST(ChromeStringCompareTest, IgnoreDiacritics) {
     13   i18n::addressinput::StringCompare sc;
     14   EXPECT_TRUE(sc.NaturalEquals("Texas", base::WideToUTF8(L"T\u00E9xas")));
     15 }
     16 
     17 TEST(ChromeStringCompareTest, IgnoreCapitalization) {
     18   i18n::addressinput::StringCompare sc;
     19   EXPECT_TRUE(sc.NaturalEquals("Texas", "teXas"));
     20 }
     21 
     22 TEST(ChromeStringCompareTest, DifferentStringAreDifferent) {
     23   i18n::addressinput::StringCompare sc;
     24   EXPECT_FALSE(sc.NaturalEquals("Texas", "California"));
     25 }
     26 
     27 }  // namespace
     28