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

Unified Diff: third_party/libaddressinput/chromium/cpp/test/address_data_test.cc

Issue 135853023: Update libaddressinput's US address format (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment Created 6 years, 11 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/cpp/src/region_data_constants.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libaddressinput/chromium/cpp/test/address_data_test.cc
diff --git a/third_party/libaddressinput/chromium/cpp/test/address_data_test.cc b/third_party/libaddressinput/chromium/cpp/test/address_data_test.cc
index e266e8a8aed4125de412469cbb1af9167bb515d8..a4d61c33afccbab30d865ef0839944f5faa2c97a 100644
--- a/third_party/libaddressinput/chromium/cpp/test/address_data_test.cc
+++ b/third_party/libaddressinput/chromium/cpp/test/address_data_test.cc
@@ -30,6 +30,32 @@ TEST(AddressDataTest, FormatForDisplayEmpty) {
EXPECT_EQ(std::vector<std::string>(), actual);
}
+TEST(AddressDataTest, FormatForDisplayUs) {
+ AddressData address;
+ address.country_code = "US";
+ address.administrative_area = "Texas";
+ address.locality = "Houston";
+ address.postal_code = "77005";
+ address.address_lines.push_back("123 Main St");
+ address.address_lines.push_back("Apt 2");
+ address.organization = "ACME Corp.";
+ address.recipient = "John Doe";
+
+ std::vector<std::string> actual;
+ address.FormatForDisplay(&actual);
+
+ std::vector<std::string> expected;
+ expected.push_back(address.recipient);
+ expected.push_back(address.organization);
+ expected.insert(expected.end(),
+ address.address_lines.begin(),
+ address.address_lines.end());
+ expected.push_back(address.locality + ", " + address.administrative_area +
+ " " + address.postal_code);
+
+ EXPECT_EQ(expected, actual);
+}
+
TEST(AddressDataTest, FormatForDisplayAr) {
AddressData address;
address.country_code = "AR";
« no previous file with comments | « third_party/libaddressinput/chromium/cpp/src/region_data_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698