Subject: | [PATCH] Prevent unneeded warnings |
Currently the test is needlessly noisy on recent perls, and the solution is simple (and included)
t/00-load.t .... 1/1 # Testing Geo::USCensus::Geocoding , Perl 5.022001, /pro/bin/perl
t/00-load.t .... ok
t/01-lookup.t .. # Testing lookup of a known good address
t/01-lookup.t .. 1/2 # 1400 J ST, SACRAMENTO, CA, 95814
Use of uninitialized value in join or string at /home/merijn/.cpan/build/b/blib/lib/Geo/USCensus/Geocoding/Result.pm line 22.
Use of uninitialized value in join or string at /home/merijn/.cpan/build/b/blib/lib/Geo/USCensus/Geocoding/Result.pm line 22.
Use of uninitialized value in join or string at /home/merijn/.cpan/build/b/blib/lib/Geo/USCensus/Geocoding/Result.pm line 22.
# Census tract
# Latitude 38.578793, Longitude -121.48778
t/01-lookup.t .. ok
t/02-fail.t .... # Testing lookup of a known nonexistent address
t/02-fail.t .... 1/1 # "1","1000 Z St, Sacramento, CA, 95814","No_Match"
t/02-fail.t .... ok
All tests successful.
Files=3, Tests=4, 1 wallclock secs ( 0.02 usr 0.01 sys + 0.35 cusr 0.00 csys = 0.38 CPU)
Result: PASS
--8<---
diff -purd a/Geocoding/Result.pm b/Geocoding/Result.pm
--- a/Geocoding/Result.pm 2015-03-14 01:29:02.000000000 +0100
+++ b/Geocoding/Result.pm 2016-02-22 12:54:36.555364202 +0100
@@ -19,7 +19,7 @@ foreach ( 'content',
sub censustract {
my $self = shift;
- return join('', $self->state, $self->county, $self->tract);
+ return join('', grep { defined } $self->state, $self->county, $self->tract);
}
1;
-->8---
=>
t/00-load.t .... 1/1 # Testing Geo::USCensus::Geocoding , Perl 5.022001, /pro/bin/perl
t/00-load.t .... ok
t/01-lookup.t .. # Testing lookup of a known good address
t/01-lookup.t .. 1/2 # 1400 J ST, SACRAMENTO, CA, 95814
# Census tract
# Latitude 38.578793, Longitude -121.48778
t/01-lookup.t .. ok
t/02-fail.t .... # Testing lookup of a known nonexistent address
t/02-fail.t .... 1/1 # "1","1000 Z St, Sacramento, CA, 95814","No_Match"
t/02-fail.t .... ok
All tests successful.
Files=3, Tests=4, 1 wallclock secs ( 0.04 usr 0.00 sys + 0.39 cusr 0.03 csys = 0.46 CPU)
Result: PASS