OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "third_party/libaddressinput/chromium/cpp/src/rule.h" | 5 #include "third_party/libaddressinput/chromium/cpp/src/rule.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 { L"\u0435\u0436VILLE", L"\u0415\u0416" }, | 44 { L"\u0435\u0436VILLE", L"\u0415\u0416" }, |
45 { L"\u0435\u0436VILL", L"" }, | 45 { L"\u0435\u0436VILL", L"" }, |
46 }; | 46 }; |
47 | 47 |
48 const size_t num_cases = sizeof(expectations) / sizeof(expectations[0]); | 48 const size_t num_cases = sizeof(expectations) / sizeof(expectations[0]); |
49 for (size_t i = 0; i < num_cases; ++i) { | 49 for (size_t i = 0; i < num_cases; ++i) { |
50 const std::string input(base::WideToUTF8(expectations[i].input)); | 50 const std::string input(base::WideToUTF8(expectations[i].input)); |
51 const std::string expected_output(base::WideToUTF8(expectations[i].output)); | 51 const std::string expected_output(base::WideToUTF8(expectations[i].output)); |
52 std::string output; | 52 std::string output; |
53 EXPECT_EQ(!expected_output.empty(), | 53 EXPECT_EQ(!expected_output.empty(), |
54 rule.CanonicalizeSubKey(input, &output)) | 54 rule.CanonicalizeSubKey(input, true, &output)) |
55 << "Failed for input " << input; | 55 << "Failed for input " << input; |
56 EXPECT_EQ(expected_output, output); | 56 EXPECT_EQ(expected_output, output); |
57 } | 57 } |
58 } | 58 } |
OLD | NEW |