From bd55f65a8030b6875f9f9388f58766adc886608f Mon Sep 17 00:00:00 2001 From: Ed Freyfogle Date: Fri, 15 Nov 2024 14:44:00 +0100 Subject: [PATCH] improve Canada (CA) fallback, with tests --- conf/countries/worldwide.yaml | 2 +- testcases/countries/ca.yaml | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/conf/countries/worldwide.yaml b/conf/countries/worldwide.yaml index 3fc3820..ff7c8c6 100644 --- a/conf/countries/worldwide.yaml +++ b/conf/countries/worldwide.yaml @@ -504,7 +504,7 @@ CA: {{{attention}}} {{{house}}} {{#first}} {{{house_number}}} {{{road}}} || {{{suburb}}} {{/first}} - {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{county}}} || {{{state_district}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}} + {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{county}}} || {{{state_district}}} || {{{region}}}{{/first}}, {{#first}} {{{state}}} || {{{state_code}}} {{/first}} {{{postcode}}} {{{country}}} postformat_replace: # fix the postcode to make it \w\w\w \w\w\w diff --git a/testcases/countries/ca.yaml b/testcases/countries/ca.yaml index 9b0a95b..602098a 100644 --- a/testcases/countries/ca.yaml +++ b/testcases/countries/ca.yaml @@ -45,7 +45,7 @@ components: state: Ontario state_code: "ON" expected: | - London, ON + London, Ontario Canada --- # London treated as county @@ -91,7 +91,7 @@ components: county: Springfield state: Manitoba expected: | - Springfield, MB + Springfield, Manitoba Canada --- # 43.60242, -79.80113 @@ -125,3 +125,14 @@ expected: | 12345 Av Demars St-Hyancinth, J2T 3T5 Canada +--- +# region +components: + country: Canada + country_code: ca + region: Greater Edmonton + state: Alberta + state_code: AB +expected: | + Greater Edmonton, Alberta + Canada