Skip to content

Commit

Permalink
More debugging when TEST_VERBOSE is set
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Oct 12, 2020
1 parent 14ded71 commit 2a6745f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/Geo/Coder/Free/MaxMind.pm
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ sub geocode {
$city->{'state'} = uc(delete $city->{'Region'});
}
if($city->{'City'}) {
$city->{'city'} = uc(delete $city->{'City'});
$city->{'city'} = uc(delete $city->{'AccentCity'});
delete $city->{'City'};
# Less likely to get false positives with long words
if(length($city->{'city'}) > 10) {
if($confidence <= 0.8) {
Expand Down
2 changes: 1 addition & 1 deletion t/maxmind.t
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ sub check($$$$) {

diag($location) if($ENV{'TEST_VERBOSE'});
my @rc = $geo_coder->geocode({ location => $location });
# diag(Data::Dumper->new([\@rc])->Dump());
diag(Data::Dumper->new([\@rc])->Dump()) if($ENV{'TEST_VERBOSE'});
ok(scalar(@rc) > 0);
cmp_deeply($rc[0],
methods('lat' => num($lat, 1e-2), 'long' => num($long, 1e-2)));
Expand Down

0 comments on commit 2a6745f

Please sign in to comment.