diff --git a/Changes b/Changes index 5678121..553fbab 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,7 @@ Revision history for Geo-Coder-List 0.33 Fix test count in t/googleplaces.t Don't test t/ua.t when network testing disabled + Use Test::Needs 0.32 Sat Oct 7 10:07:45 EDT 2023 Set "geocoder" to "cached" when the values have been retrieved from the L2 cache diff --git a/Makefile.PL b/Makefile.PL index 63e8d46..f2f73c1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -23,8 +23,9 @@ if($ENV{AUTHOR_TESTING}) { my $test_requires = { 'Test::Deep' => 0, 'Test::Most' => 0, - 'Test::Number::Delta' => 0, # Always needed since used in free.t + 'Test::Needs' => 0, 'Test::NoWarnings' => 0, + 'Test::Number::Delta' => 0, # Always needed since used in free.t }; if($online_tests) { diff --git a/t/eof.t b/t/eof.t index f1365cb..f61ae39 100644 --- a/t/eof.t +++ b/t/eof.t @@ -2,20 +2,14 @@ use strict; use warnings; +use Test::Needs 'Test::EOF'; use Test::Most; BEGIN { - if($ENV{AUTHOR_TESTING}) { - eval { - require Test::EOF; - }; - if($@) { - plan(skip_all => 'Test::EOF not installed'); - } else { - import Test::EOF; - all_perl_files_ok({ minimum_newlines => 1, maximum_newlines => 4 }); - done_testing(); - } + if($ENV{'AUTHOR_TESTING'}) { + Test::EOF->import(); + all_perl_files_ok({ minimum_newlines => 1, maximum_newlines => 4 }); + done_testing(); } else { plan(skip_all => 'Author tests not required for installation'); } diff --git a/t/eol.t b/t/eol.t index 3360315..4a4d26c 100644 --- a/t/eol.t +++ b/t/eol.t @@ -1,19 +1,14 @@ +#!/usr/bin/env perl + use strict; use warnings; - +use Test::Needs 'Test::EOL'; use Test::Most; BEGIN { - if($ENV{AUTHOR_TESTING}) { - eval { - require Test::EOL; - }; - if($@) { - plan(skip_all => 'Test::EOL not installed'); - } else { - import Test::EOL; - all_perl_files_ok({ trailing_whitespace => 1 }); - } + if($ENV{'AUTHOR_TESTING'}) { + Test::EOL->import(); + all_perl_files_ok({ trailing_whitespace => 1 }); } else { plan(skip_all => 'Author tests not required for installation'); } diff --git a/t/free.t b/t/free.t index e4c1966..9cee127 100644 --- a/t/free.t +++ b/t/free.t @@ -70,7 +70,7 @@ FREE: { my $location = $geo_coder_list->geocode('Woolwich, London, England'); cmp_deeply($location, - methods('lat' => num(51.47, 1e-2), 'long' => num(0.20, 1e-2))); + methods('lat' => num(51.4, 1e-1), 'long' => num(0.20, 1))); if($ENV{'OPENADDR_HOME'}) { $location = $geo_coder_list->geocode(location => 'Margate, Kent, England'); @@ -86,7 +86,7 @@ FREE: { # Check cache $location = $geo_coder_list->geocode('Woolwich, London, England'); cmp_deeply($location, - methods('lat' => num(51.4, 1e-1), 'long' => num(0.20, 1e-2))); + methods('lat' => num(51.4, 1e-1), 'long' => num(0.20, 1))); my @locations = $geo_coder_list->geocode(location => 'Herne Bay, Kent, England'); cmp_deeply($locations[0], diff --git a/t/pod-synopsis.t b/t/pod-synopsis.t index 6ba471f..1ae87ea 100644 --- a/t/pod-synopsis.t +++ b/t/pod-synopsis.t @@ -3,15 +3,11 @@ use strict; use warnings; use Test::Most; +use Test::Needs 'Test::Synopsis'; if($ENV{AUTHOR_TESTING}) { - eval 'use Test::Synopsis'; - - if($@) { - plan(skip_all => 'Test::Synopsis required for testing POD Synopsis'); - } else { - all_synopsis_ok(); - } + Test::Synopsis->import(); + all_synopsis_ok(); } else { plan(skip_all => 'Author tests not required for installation'); }