-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64ee24c
commit 54a68bf
Showing
5 changed files
with
137 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ t/cities.t | |
t/comment-spelling.t | ||
t/coverage.t | ||
t/critic.t | ||
t/dr5hn.t | ||
t/eof.t | ||
t/eol.t | ||
t/fixme.t | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!perl -w | ||
|
||
# TODO: Try using Test::Without::Module to try without Geo::libpostal is that | ||
# is installed | ||
|
||
use warnings; | ||
use strict; | ||
use Data::Dumper; | ||
use Test::Most tests => 5; | ||
use Test::Number::Delta; | ||
use Test::Carp; | ||
use Test::Deep; | ||
use lib 't/lib'; | ||
use MyLogger; | ||
|
||
BEGIN { | ||
use_ok('Geo::Coder::Free'); | ||
} | ||
|
||
DR5HN: { | ||
SKIP: { | ||
if($ENV{'DR5HN_HOME'} && $ENV{'OPENADDR_HOME'}) { | ||
if($ENV{AUTHOR_TESTING}) { | ||
diag('This will take some time and memory'); | ||
|
||
my $libpostal_is_installed = 0; | ||
if(eval { require Geo::libpostal; }) { | ||
$libpostal_is_installed = 1; | ||
} | ||
|
||
if($ENV{'TEST_VERBOSE'}) { | ||
Database::Abstraction::init(logger => MyLogger->new()); | ||
} | ||
|
||
my $geo_coder = new_ok('Geo::Coder::Free'); | ||
my $location = $geo_coder->geocode(location => 'Silver Spring, MD, USA'); | ||
ok(defined($location)); | ||
cmp_deeply($location, | ||
methods('lat' => num(38.99, 1e-2), 'long' => num(-77.02, 1e-1))); | ||
|
||
diag(Data::Dumper->new([$location])->Dump()) if($ENV{'TEST_VERBOSE'}); | ||
|
||
eval 'use Test::Memory::Cycle'; | ||
if($@) { | ||
skip('Test::Memory::Cycle required to check for cicular memory references', 1); | ||
} else { | ||
memory_cycle_ok($geo_coder); | ||
} | ||
} else { | ||
diag('Author tests not required for installation'); | ||
skip('Author tests not required for installation', 4); | ||
} | ||
} else { | ||
diag('Set DR5HN_HOME and OPENADDR_HOME to enable dr5hn testing'); | ||
skip('DR5HN_HOME and/or OPENADDR_HOME not defined', 4); | ||
} | ||
} | ||
} |