Skip to content

Commit

Permalink
Better testing of different data sets
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jul 3, 2024
1 parent 26046ce commit 5b1680c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 6 additions & 6 deletions t/manifest.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use strict;
use warnings;
use Test::Most;

unless ( $ENV{AUTHOR_TESTING} ) {
plan( skip_all => "Author tests not required for installation" );
if($ENV{AUTHOR_TESTING}) {
eval 'use Test::CheckManifest 0.9';
plan(skip_all => 'Test::CheckManifest 0.9 required') if $@;
ok_manifest({ filter => [qr/(\.git)|(\..+\.yml$)/] });
} else {
plan(skip_all => 'Author tests not required for installation');
}

eval "use Test::CheckManifest 0.9";
plan skip_all => "Test::CheckManifest 0.9 required" if $@;
ok_manifest({ filter => [qr/.git/] });
14 changes: 9 additions & 5 deletions t/openaddr.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ OPENADDR: {

$location = $geo_coder->geocode('Indiana, USA');
cmp_deeply($location,
methods('lat' => num(40.07, 1e-2), 'long' => num(-86.27, 1e-2)));
methods('lat' => num(39, 1), 'long' => num(-86, 1)));

$location = $geo_coder->geocode('Indianapolis, Indiana, USA');
ok(defined($location));
Expand Down Expand Up @@ -68,9 +68,13 @@ OPENADDR: {
};
}

$location = $geo_coder->geocode(location => 'Greene County, Indiana, USA');
cmp_deeply($location,
methods('lat' => num(39.05, 1e-2), 'long' => num(-87.04, 1e-2)));
if($ENV{'WHOSONFIRST_HOME'}) {
$location = $geo_coder->geocode(location => 'Greene County, Indiana, USA');
cmp_deeply($location,
methods('lat' => num(39.05, 1e-2), 'long' => num(-87.04, 1e-2)));
} else {
ok(!defined($geo_coder->geocode(location => 'Greene County, Indiana, USA')));
}

$location = $o_geo_coder->geocode('Boswell, Somerset, Pennsylvania, USA');
ok(defined($location));
Expand Down Expand Up @@ -149,7 +153,7 @@ OPENADDR: {

$location = $geo_coder->geocode('Wisconsin, USA');
cmp_deeply($location,
methods('lat' => num(44.19, 1e-2), 'long' => num(-89.57, 1e-2)));
methods('lat' => num(44, 1), 'long' => num(-90, 1)));

$location = $geo_coder->geocode('At sea or abroad');
ok(!defined($location));
Expand Down

0 comments on commit 5b1680c

Please sign in to comment.