fix: normalization of city name address
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package lookup
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestTitleCase(t *testing.T) {
|
||||
cases := map[string]string{
|
||||
"NOEL CHENAVARD": "Noel Chenavard",
|
||||
"VETRAZ-MONTHOUX": "Vetraz-Monthoux",
|
||||
"o'brien": "O'Brien",
|
||||
"866 ROUTE DES VOIRONS": "866 Route Des Voirons",
|
||||
"PARIS": "Paris",
|
||||
"": "",
|
||||
" saint-étienne ": "Saint-Étienne",
|
||||
"JOHN": "John",
|
||||
}
|
||||
for in, want := range cases {
|
||||
if got := titleCase(in); got != want {
|
||||
t.Errorf("titleCase(%q) = %q, want %q", in, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user